Section Progress
0% Complete

Applying logistic regression to estimate PS

You need to apply a logistic regression model to estimate the probability of receiving a high potency statin from the baseline characteristics (i.e., predefined covariates). Because we are estimating the probability of the exposure group (statin dose), here the exposure is modelled as the dependant variable, and the predefined covariates as the independent variables.

Below is some example code that can be used to apply a logistic regression to estimate a propensity score in SAS. This code can be edited as needed.

* Manually estimating propensities with a logistic regression model;
proc logistic data= <insert data name>;
  class C1 C2 ......./ param=ref ;
  model X (event = "1") =  C1 C2 ........;
  output out = PS_out pred = ps xbeta=logit_ps; 
run;

Step 1: Estimating PS

Use PROC LOGISTIC to estimate propensity score and save scores in existing data set. First try doing this on your own using the simulated data sets.

Reveal example code below if you need a hint or want to check your work.

Example code (click to reveal)

proc logistic data= cohort;
  class 4_drug 4_diag htn cholest pvd chf loop/ param=ref ;
  model Exposure (event = "1") =  year 4_drug 4_diag htn cholest pvd chf loop;
  output out = PS_out pred = ps xbeta=logit_ps; 
run;