BookmarkSubscribeRSS Feed
burtsm
Calcite | Level 5

I have the following code to generate predicted probabilities of child death when education=edu1 at different origin of births (SADC, ROA, and SA). However, I want to set the continuous regressors to their mean, some categorical regressors to 1, and some categorical regressors to 0. Can you help me code these "adjustments"?

 

What I have:

 

proc qlim data=sa.Ipumsi_sa_reg;
    model CHDIED=SADC ROA AGE EDU2 EDU3 EDU4 EDU5 EDU6 MARRIED PERSONS EMPLOY OWNER URBAN_I URBAN_F IMOVER RECENT / DISCRETE(d=probit);
    weight WTPER;
    where OSEAS=0 and 20 le AGE le 35 and EDU1=1;
    output out=outpp_edu1 proball;
run;
quit;



proc means data=outpp_edu1;
var Prob2_CHDIED;
where sadc=1;
run;

proc means data=outpp_edu1;
var Prob2_CHDIED;
where roa=1;
run;

proc means data=outpp_edu1;
var Prob2_CHDIED;
where sa=1;
run;

 

 

Thank you!
Stephanie

2 REPLIES 2
PGStats
Opal | Level 21

I am not a user of proc qlim. So this is just an educated guess of how to get your predictions. The idea is to add extra observations with missing dependent values. The extra obs will not be used for estimation but the procedure will compute predicted values for them.

 

/* Create 3 combinations of binary predictors where predictions 
are wanted */

data predBin;
input 
	label :$5./
	SADC ROA OSEAS /
	EDU1 EDU2 EDU3 EDU4 EDU5 EDU6 /
	MARRIED EMPLOY OWNER /
	URBAN_I URBAN_F IMOVER RECENT;
datalines;
SADC
1 0 0 
1 0 0 0 0 0 
1 0 1 
0 1 0 1 
ROA
0 1 0  
1 0 0 0 0 0 
1 0 1 
0 1 0 1
OSEAS 
0 0 1  
1 0 0 0 0 0 
1 0 1 
0 1 0 1 
;

proc sql;

/* Compute the means of continuous predictors */
create table predMeans as
select mean(age) as age, mean(persons) as persons
from sa.lpumsi_sa_reg;

/* Merge binary and continuous predictors */
create table predValues as
select predBin.*, predMeans.* 
from predBin, predMeans;

/* Add the extra observations to original data */
create table lpumsi_sa_reg as
select "DATA" as label length=5, * from  sa.lpumsi_sa_reg
union all corr
select . as chdied, 1 as wtper, * from predValues;
quit;

proc qlim data=Ipumsi_sa_reg;
    model CHDIED=SADC ROA OSEAS AGE EDU1 EDU2 EDU3 EDU4 EDU5 EDU6 
	MARRIED PERSONS EMPLOY OWNER URBAN_I URBAN_F IMOVER RECENT / DISCRETE(d=probit);
    weight WTPER;
    output out=outpp proball;
run;

(untested)

PG
burtsm
Calcite | Level 5

Thank you PGStats.

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1368 views
  • 1 like
  • 2 in conversation