BookmarkSubscribeRSS Feed
SASdependent
Calcite | Level 5

I am trying to calculate a propensity score (ps) using PROC LOGISTIC (I also tried using PROC GENMOD with a binary distribution and had the same problem). My outcome variable ('frcd_dic' is dichotomous). As you may notice, I am running these analyses on imputed data (consequently variables black, white, and eversex, which are typically dichotomous,  are actually continuous). Below is the syntax I am using:

Proc logistic data = P2data11212014 descending;

  class frcd_dic school class; 

  Model frcd_dic = school class Black White rlnshp ptnrage dysabsnt delinquency lifeSU eversex makesex

sexnorms sexbeliefs cntrlsex sexsixmo sixmoptnrA sexagr stoptryNZ refusesx  / link = logit ;

  by _imputation_;

output out = P2propensity_scores

  p = ps

  xbeta =plogit;

Run;

My problem is that 'ps' is not being calculated. After running this syntax I end up with a missing value 'ps' for all of my observations. I've spend a substantial amount of time trying to figure out my error and was hoping someone here could help me figure out what I am doing wrong. Not sure if this matters, but I am using SAS 9.4. Thanks in advance for your help!

2 REPLIES 2
Reeza
Super User

Hard to say.  Any other errors or notes in your log? How many observations in your data?

Add param=ref to your class statement as well.

Proc logistic data = P2data11212014 descending;

  class frcd_dic school class/param=ref;

  Model frcd_dic = school class Black White rlnshp ptnrage dysabsnt delinquency lifeSU eversex makesex

sexnorms sexbeliefs cntrlsex sexsixmo sixmoptnrA sexagr stoptryNZ refusesx  / link = logit ;

  by _imputation_;

output out = P2propensity_scores

  p = ps

  xbeta =plogit;

Run;

SASdependent
Calcite | Level 5

Thank you for your response. I actually am feeling quite foolish right now. There were no errors in the log, but there was a note saying that the variable ps already exist, so ps2 was used instead. The note was lost in the notes about the model converging in all 40 imputed datasets, so I hadn't noticed it.  I ran the syntax several times with slight variations to try and create the variable 'ps' so that must be how it was previously created, but I'm still not sure why the variable kept coming back missing. I closed sas to clear my work file,  re-opened it and ran my program and now I have my ps variable! Thank you again.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 945 views
  • 4 likes
  • 2 in conversation