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.

_R_e_f_e_r_e_n_c_e_s:

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth Edition. Springer.

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

     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))

     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()

     require(lattice)
     xyplot(Yhat ~ Conc | Strip, Muscle, as.table = TRUE,
        ylim = range(c(Muscle$Yhat, Muscle$logLength), na.rm = TRUE),
        subscripts = TRUE, xlab = "Calcium Chloride concentration (mM)",
        ylab = "log(Length in mm)", panel =
        function(x, y, subscripts, ...) {
           lines(spline(x, y))
           panel.xyplot(x, Muscle$logLength[subscripts], ...)
        })

