Hello.
I am conducting mi procedure. My outcome is 3 variables. I used fcs logistic.
step 1/* Impute missing data using logistic regression */
proc mi data=mydata_mental seed=12345 nimpute=20 out=outfcs_impute;
where _age_g=6;
class ment14d_w fall12mn_w _sex age65plus_w urbstat_w educag_w racegr4_w income_w marital_w hlthpl1_w persdoc3_w medcost1_w checkup1_w exerany2_w;
fcs logistic (ment14d_w/details) logistic (income_w) ;
var ment14d_w fall12mn_w _sex age65plus_w urbstat_w educag_w racegr4_w marital_w hlthpl1_w persdoc3_w medcost1_w checkup1_w exerany2_w _ststr _psu _llcpwt income_w;
run;
step 2
/* Analyze each imputed dataset using logistic regression */ This works
********
proc logistic data = outfcs_impute;
Class ment14d_w (ref="0") fall12mn_w (ref="0") _sex (ref="1") age65plus_w (ref="1") urbstat_w(ref="1") educag_w (ref="1") racegr4_w(ref="1") income_w(ref="1") marital_w(ref="1") hlthpl1_w(ref="0") persdoc3_w(ref="0") medcost1_w(ref="0") checkup1_w(ref="0") exerany2_w(ref="0")/param=ref;
model ment14d_w = fall12mn_w _sex age65plus_w urbstat_w educag_w racegr4_w income_w marital_w hlthpl1_w persdoc3_w medcost1_w checkup1_w exerany2_w / link = glogit covb;
by _imputation_;
ods output ParameterEstimates=lgsparms CovB=lgscovb;
run;
/* Pool results across imputed datasets */ (this works but I do not get coefficient for (3 categories for dependent var)
proc mianalyze parms(classvar=classval)=lgsparms;
class ment14d_w fall12mn_w _sex age65plus_w urbstat_w educag_w racegr4_w income_w marital_w hlthpl1_w persdoc3_w medcost1_w checkup1_w exerany2_w;
modeleffects intercept ment14d_w fall12mn_w _sex age65plus_w urbstat_w educag_w racegr4_w income_w marital_w hlthpl1_w persdoc3_w medcost1_w checkup1_w exerany2_w;
run;
My questions.
How can I get odds ratio (in simple step) in pooled results after mianalyze?
How can I get coefficient value for final output after mianalyze?
There is no way to combine the odds ratios directly since there is not a reported standard error. Instead you must combine the parameter estimates and then use a Data Step to compute the odds ratios. Below is an example similar to your setup.
data school;
length Program $ 9;
input School Program $ Style $ NumStudent Count @@;
datalines;
1 regular self 21 10 1 regular team 22 17 1 regular class 16 26
1 afternoon self 23 5 1 afternoon team 26 12 1 afternoon class 21 50
2 . self 22 21 2 regular team 31 17 2 regular class 32 26
2 . . 18 16 2 afternoon team 28 12 2 afternoon class 27 36
3 regular self 14 15 3 regular team 32 15 3 regular class 31 16
3 afternoon self 19 12 3 afternoon team 30 12 3 . class 33 20
;
proc mi data=school out=school_imp;
freq count;
class school style program;
var NumStudent school style program;
monotone discrim (style=NumStudent);
monotone logistic (program=school style);
title 'Proc MI results for monotone Logistic model';
run;
proc logistic data=school_imp;
by _imputation_;
freq Count;
class School Program(ref=first)/param=ref;
model Style(order=data)=School Program NumStudent / link=glogit;
ods output ParameterEstimates=imp_parms;
run;
proc mianalyze parms(classvar=classval link=glogit)=imp_parms edf=328;
class school program;
modeleffects intercept school program numstudent;
ods output parameterestimates=mianalyze_parms;
run;
data OR;
set mianalyze_parms(where=(parm ne 'intercept'));
OR=exp(estimate);
LCL_OR=exp(LCLMean);
UCL_OR=exp(UCLMean);
proc print;
var parm school program response OR LCL_OR UCL_OR;
run;
How is edf number chosen? How can I set that number? Is it a random number?
edf=328;
Thank you. I now know how to set edf.
I tried to follow the codes as follow.
proc mianalyze parms(classvar=classval link=glogit)=imp_parms edf=328;
class school program;
modeleffects intercept school program numstudent;
ods output parameterestimates=mianalyze_parms;
run;
data OR;
set mianalyze_parms(where=(parm ne 'intercept'));
OR=exp(estimate);
LCL_OR=exp(LCLMean);
UCL_OR=exp(UCLMean);
proc print;
var parm school program response OR LCL_OR UCL_OR;
run;
But, I received the following errors.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.