- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.