SPSnbins                package:USPS                R Documentation

_C_h_a_n_g_e _t_h_e _N_u_m_b_e_r _o_f _B_i_n_s _i_n _S_u_p_e_r_v_i_s_e_d _P_r_o_p_e_n_s_i_y _S_c_o_r_i_n_g

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

     Change the Number of Bins in Supervised Propensiy Scoring

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

     dframe2 <- SPSnbins(dframe1, prnk, qbin, bins=8)

_A_r_g_u_m_e_n_t_s:

 dframe1: Name of data.frame of the form output by SPSlogit().

    prnk: Name of PS tied-rank variable from previous call to
          SPSlogit().

    qbin: Name of variable to contain the re-assigned bin number for
          each patient.

    bins: Number of PS bins desired.

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

     Part or all of the first phase of Supervised Propensity Scoring
     will need to be redone if SPSbalan() detects dependence of
     within-bin X-covariate distributions upon treatment choice. Use
     SPSnbins() to change (increase) the number of adjacent PS bins. 
     If this does not achieve balance, invoke SPSlogit() again to
     modify the form of your PS logistic model, typically by adding
     interaction and/or curvature terms in continuous X-covariates.

_V_a_l_u_e:

     An output data.frame with new variables inserted: 

 dframe2: Modified version of the data.frame specified as the first
          argument to SPSnbins().

_A_u_t_h_o_r(_s):

     Bob Obenchain <sunsetstats@earthlink.net>

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

     Cochran WG. (1968) The effectiveness of adjustment by
     subclassification in removing bias in observational studies.
     _Biometrics_ *24*: 205-213.

     Obenchain RL. (2005) *USPSinR.pdf*  ../R_HOME/library/USPS  40
     pages.

     Rosenbaum PR, Rubin DB. (1984) Reducing Bias in Observational
     Studies Using Subclassification on a Propensity Score. _J Amer
     Stat Assoc_ *79*: 516-524.

_S_e_e _A_l_s_o:

     'SPSlogit', 'SPSbalan' and 'SPSoutco'.

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

       data(lindner)
       PStreat <- abcix~stent+height+female+diabetic+acutemi+ejecfrac+ves1proc
       logtSPS <- SPSlogit(lindner, PStreat, PSfit, PSrnk, PSbin, appn="lindSPS")
       logtSPS

       # If imbalance within the SPSlogit() default of bins=5 was detected, then ...

       lindSPS <- SPSnbins(lindSPS, PSrnk, PSbin6, bins=6)
       table(lindSPS$PSbin,lindSPS$PSbin6)

