scd                  package:survey                  R Documentation

_S_u_r_v_i_v_a_l _i_n _c_a_r_d_i_a_c _a_r_r_e_s_t

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

     These data are from Section 12.2 of Levy and Lemeshow.  They
     describe (a possibly apocryphal) study of survival in
     out-of-hospital cardiac arrest. Two out of five ambulance stations
     were sampled from each of three emergency service areas.

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

     data(scd)

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

     This data frame contains the following columns:

     _E_S_A Emergency Service Area (strata)

     _a_m_b_u_l_a_n_c_e Ambulance station (PSU)

     _a_r_r_e_s_t_s estimated number of cardiac arrests

     _a_l_i_v_e number reaching hospital alive

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

     Levy and Lemeshow. "Sampling of Populations" (3rd edition). Wiley.

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

     data(scd)

     ## survey design objects
     scddes<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
     nest=TRUE, fpc=rep(5,6))
     scdnofpc<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
     nest=TRUE)

     # convert to BRR replicate weights
     scd2brr <- as.svrepdesign(scdnofpc, type="BRR")

     # use BRR replicate weights from Levy and Lemeshow
     repweights<-2*cbind(c(1,0,1,0,1,0), c(1,0,0,1,0,1), c(0,1,1,0,0,1),
     c(0,1,0,1,1,0))
     scdrep<-svrepdesign(data=scd, type="BRR", repweights=repweights)

     # ratio estimates
     svyratio(~alive, ~arrests, design=scddes)
     svyratio(~alive, ~arrests, design=scdnofpc)
     svyratio(~alive, ~arrests, design=scd2brr)
     svyratio(~alive, ~arrests, design=scdrep)

     # or a logistic regression
     summary(svyglm(cbind(alive,arrests-alive)~1, family=quasibinomial, design=scdnofpc))
     summary(svyglm(cbind(alive,arrests-alive)~1, family=quasibinomial, design=scdrep))

     # Because no sampling weights are given, can't compute design effects
     # without replacement: use deff="replace"

     svymean(~alive+arrests, scddes, deff=TRUE)
     svymean(~alive+arrests, scddes, deff="replace")

