muscle                 package:MASS                 R Documentation

_E_f_f_e_c_t _o_f _C_a_l_c_i_u_m _C_h_l_o_r_i_d_e _o_n _M_u_s_c_l_e _C_o_n_t_r_a_c_t_i_o_n _i_n _R_a_t _H_e_a_r_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     The purpose of this experiment was to assess the influence of
     calcium in solution on the contraction of heart muscle in rats.
     The left auricle of 21 rat hearts was isolated and on several
     occasions a constant-length strip of tissue was electrically
     stimulated and dipped into various concentrations of calcium
     chloride solution, after which the shortening of the strip was
     accurately measured as the response.

_U_s_a_g_e:

     data(muscle)

_F_o_r_m_a_t:

     This data frame contains the following columns:

     `_S_t_r_i_p' which heart muscle strip was used?

     `_C_o_n_c' concentration of calcium chloride solution, in multiples of
          2.2 mM.

     `_L_e_n_g_t_h' the change in length (shortening) of the strip,
          (allegedly) in mm.

_S_o_u_r_c_e:

     Linder, A., Chakravarti, I. M. and Vuagnat, P. (1964) Fitting
     asymptotic regression curves with different asymptotes. In
     Contributions to Statistics. Presented to Professor P. C.
     Mahalanobis  on the occasion of his 70th birthday, ed. C. R. Rao,
     pp. 221-228. Oxford: Pergamon Press.

_E_x_a_m_p_l_e_s:

     library(nls)
     data(muscle)
     A <- model.matrix(~ Strip - 1, data=muscle)
     rats.nls1 <- nls(log(Length) ~ cbind(A, rho^Conc), 
        data = muscle, start = c(rho=0.1), algorithm="plinear")
     B <- coef(rats.nls1)
     B

     st <- list(alpha = B[2:22], beta = B[23], rho = B[1])  
     rats.nls2 <- nls(log(Length) ~ alpha[Strip] + beta*rho^Conc,
                       data = muscle, start = st)
     rats.nls2

     attach(muscle)
     Muscle <- expand.grid(Conc = sort(unique(Conc)), 
                          Strip = levels(Strip))
     Muscle$Yhat <- predict(rats.nls2, Muscle)
     Muscle <- cbind(Muscle, logLength = rep(as.numeric(NA), 126))
     ind <- match(paste(Strip, Conc), 
                 paste(Muscle$Strip, Muscle$Conc))
     Muscle$logLength[ind] <- log(Length)
     detach()

     coplot(Yhat ~ Conc | Strip, data=Muscle,
       subscripts = TRUE, xlab = "Calcium Chloride concentration (mM)",
       ylab = "log(Length in mm)", show.given = FALSE, panel = 
       function(x, y, subscripts, ...) {
          lines(spline(x, y))
          points(x, Muscle$logLength[subscripts], ...)
       })

