BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kyra
Quartz | Level 8

Hi,

 

I have run the proc mianalyze procedure using the code-

proc mianalyze parms=lgsparms;
modeleffects Intercept age;
run;

 

and the output i got is below. I am wondering if there is a way to get pooled ORs.

 

Thanks,

Prerna

 

SAS Output

LOGISTIC Model Coefficients (First Two Imputations)

The MIANALYZE Procedure
Model InformationPARMS Data SetNumber of Imputations
WORK.LGSPARMS
15

 

Variance Information (15 Imputations)Parameter Variance DF RelativeIncreasein Variance FractionMissingInformation RelativeEfficiencyBetween Within TotalInterceptage
0.0000715630.8348950.8349711.68E90.0000914290.0000914220.999994
3.7856008E-80.0005910.0005913E90.0000683090.0000683050.999995

 

Parameter Estimates (15 Imputations)Parameter Estimate Std Error 95% Confidence Limits DF Minimum Maximum Theta0 t for H0:Parameter=Theta0 Pr > |t|Interceptage
-0.9847670.913767-2.775720.806181.68E9-1.007942-0.9774100-1.080.2812
-0.0577410.024314-0.10540-0.010093E9-0.057897-0.0571920-2.370.0176

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SAS_Rob
SAS Employee
Proc MIANALYZE cannot report odds ratios directly because it requires both a point estimate and a standard error as input. LOGISTIC does not produce a standard error for the odds ratio. One thing you could do is to combine the parameter estimates and then compute the combined odds ratios in a data step. This is straightforward for continuous variables as the odds ratio is simply exp(beta) but for categorical variables you will need to make sure and use the PARAM=REF or PARAM=GLM options on the CLASS statement which compares each level against the reference level and is the basis for odds ratios. Something like the example at the bottom of this email would work.



/*Assume that the imputation has already been done*/

data test;

seed=2534565;

do _imputation_=1 to 5;

do a=1 to 3;

do b=1 to 2;

do i=1 to 250;

x1=ranuni(21);

logit=-2 + .05*a+.45*b+.88*a*b;

p=exp(-logit)/(1+exp(-logit));

if ranuni(seed)>p then y=1; else y=0;

output;

end;

end;

end;

end;

run;

proc surveylogistic data=test;

by _imputation_;

class a/param=ref;

model y=a x1;

ods output parameterestimates=parms_ds;

run;





proc mianalyze parms(classvar=classval)=parms_ds;

class a;

modeleffects x1 a;

ods output parameterestimates=mianalyze_parms;

run;



data OR;

set mianalyze_parms;

OR=exp(estimate);

LCL_OR=exp(LCLMean);

UCL_OR=exp(UCLMean);

proc print;

var parm a OR LCL_OR UCL_OR;

run;




View solution in original post

5 REPLIES 5
SAS_Rob
SAS Employee
Proc MIANALYZE cannot report odds ratios directly because it requires both a point estimate and a standard error as input. LOGISTIC does not produce a standard error for the odds ratio. One thing you could do is to combine the parameter estimates and then compute the combined odds ratios in a data step. This is straightforward for continuous variables as the odds ratio is simply exp(beta) but for categorical variables you will need to make sure and use the PARAM=REF or PARAM=GLM options on the CLASS statement which compares each level against the reference level and is the basis for odds ratios. Something like the example at the bottom of this email would work.



/*Assume that the imputation has already been done*/

data test;

seed=2534565;

do _imputation_=1 to 5;

do a=1 to 3;

do b=1 to 2;

do i=1 to 250;

x1=ranuni(21);

logit=-2 + .05*a+.45*b+.88*a*b;

p=exp(-logit)/(1+exp(-logit));

if ranuni(seed)>p then y=1; else y=0;

output;

end;

end;

end;

end;

run;

proc surveylogistic data=test;

by _imputation_;

class a/param=ref;

model y=a x1;

ods output parameterestimates=parms_ds;

run;





proc mianalyze parms(classvar=classval)=parms_ds;

class a;

modeleffects x1 a;

ods output parameterestimates=mianalyze_parms;

run;



data OR;

set mianalyze_parms;

OR=exp(estimate);

LCL_OR=exp(LCLMean);

UCL_OR=exp(UCLMean);

proc print;

var parm a OR LCL_OR UCL_OR;

run;




Kyra
Quartz | Level 8

Hi,

 

I have one follow up question.

 

I understand that  with multiple imputation we end up with multiple datasets and proc mianalyze helps us to get pooled estimates.

 

Is there a way to combine multiply imputed datasets into one dataset at the end.

 

Thanks,

Prerna

 

SAS_Rob
SAS Employee

No, there is nothing that will do this directly and there isn't really a widely accepted way you coud do this.

Kyra
Quartz | Level 8

Thank you very much for quick response.

ChuksManuel
Pyrite | Level 9
Hello,
I know it's been 2 years since you solved this problem.
I get your codes in this example.
What if i had an interaction term. how can i output the Odds ratio. For example, if my model is
model y=a x1 a*x1;
How can i get the OR in this case if both a and x1 are categorical variables.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 5410 views
  • 0 likes
  • 3 in conversation