anesthetic               package:DAAG               R Documentation

_A_n_e_s_t_h_e_t_i_c _E_f_f_e_c_t_i_v_e_n_e_s_s

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

     Thirty patients were given an anesthetic agent maintained at a
     predetermined level (conc) for 15 minutes before making an
     incision.  It was then noted whether the patient moved, i.e.
     jerked or twisted.

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

     anesthetic

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

     This data frame contains the following columns:

     _m_o_v_e a binary numeric vector coded for  patient movement (0 = no
          movement, 1 = movement)

     _c_o_n_c anesthetic concentration

     _l_o_g_c_o_n_c logarithm of concentration

     _n_o_m_o_v_e the complement of move

_D_e_t_a_i_l_s:

     The interest is in estimating how the probability of jerking or
     twisting varies with increasing concentration of the anesthetic
     agent.

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

     unknown

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

     print("Logistic Regression - Example 8.1.4")

     z <- table(anesthetic$nomove, anesthetic$conc)
     tot <- apply(z, 2, sum)         # totals at each concentration
     prop <- z[2,  ]/(tot)           # proportions at each concentration
     oprop <- sum(z[2,  ])/sum(tot)  # expected proportion moving if concentration had no effect
     conc <- as.numeric(dimnames(z)[[2]])
     plot(conc, prop, xlab = "Concentration", ylab = "Proportion", xlim = c(.5,2.5),
         ylim = c(0, 1), pch = 16)
     chw <- par()$cxy[1]
     text(conc - 0.75 * chw, prop, paste(tot), adj = 1)
     abline(h = oprop, lty = 2)

     pause()

     anes.logit <- glm(nomove ~ conc, family = binomial(link = logit),
       data = anesthetic)
     anova(anes.logit)
     summary(anes.logit)

