Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Proc Mianalyze: obtaining combined results for categorical variable (g...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-08-2013 05:53 AM
(7974 views)

Hello,

I wonder if it is possible to obtain an overall result for a comparison of means for a categorical variable.

The standard SAS codes show how to obtain combined parameter estimates (for each of the levels of my variable),

but I haven't found instructions on how to obtain combined overall p-values for categorical variables anywhere.

The "outstats=xxx" option in proc glm (by _imputation_) allows me to obtain overall p-values for each imputation.

But I cannot combine them simply by stating proc mianalyze data=XXX as SAS will not recognize the variables

listed under _SOURCE_ as modeleffects.

Thank you very much in advance for any ideas on this!

19 REPLIES 19

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Karen,

Check out Example 58.6 Reading GLM Results from PARMS= and XPX!= Data Sets in the documentation, and Example 58.8 Reading Mixed Model Results with Classification Variables. You will probably have to add a TEST statement to get what you are finally looking for.

If these examples don't get you started in the right direction, please provide additional details.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you very much for your answer! I could not really work out how to get results for the overall F-test from these examples. However, when looking for how to combine imputed results on LS-Means, I found this document (that also covers a solution for the F-test problem) A Method of Using Multiple Imputation in Clinical Data Analysis | www.pnwsug.org

I have not tried it yet but I hope it will work!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Interesting paper and approach to getting LSmeans and the associated standard errors. I have, however, "great fear and loathing" about the calculation of standard errors for the differences between LSmeans across imputation, as I don't see a variance-covariance matrix in the code in Example 7. I fear that without the covariances, somehow averaged over imputations, the standard errors of the differences will be off. See https://communities.sas.com/message/149498#149498 for more on this, where it becomes apparent that the assumption of independence between variables and levels of variables leads to mis-estimation of standard errors of the differences between LSmeans (and that would be the loathing part, because it was my mistake). If this is where you eventually need to be (comparing levels of fixed effects after imputation), then it is going to get much more difficult.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Karen,

Can you provide specific code for what you have done to circumvent this problem?

I suspect I am encouring a similar issue. I want to obtain an overall Fand p value for treatment (from the mianalyze step) for a model that has a 3-level categorical predictor (3 different types of treatment).

I get a warning message when I run the glm step.

proc glm data = XX;

class tx_condition;

model continuous_dv = continuous_iv tx_condition/inverse;

by _imputation_;

ods output

parameterestimates = glmparms

invxpx = glmpxi;

run;

***WARNING MESSAGE:

'ParameterEstimates' was not created. ****

Then when I turn to step 3 (mianalyze) I get an error.

proc mianalyze;

class tx_condition;

model effects intercept continuous_iv tx_condition;

parms = glmparms;

xpxi = glmpxi edf = 218;

run;

*** ERROR MESSAGE:

Parms Statement is not valid or it is used out of proper order***

I have read around and suspect it's an issue with the class statement but I'm not sure how to get around this problem.

Thanks in advance for any thoughts/suggestions!

Amy

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Amy,

On the proc mianalyze front, the parms=, xpxi=, and edf= statements should be made options in the proc mianalyze statement. That is:

proc mianalyze parms(classvar=full)=glmparms xpxi=glmpxi edf=218;

/* Note the inclusion of the classvar= option to indicate that there are categorical variables */

class tx_condition;

model effects intercept continuous_iv tx_condition;

run;

For the proc glm, add solution as an option after inverse.

Good luck.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Amy,

I am not sure if I'll be of great help as I am absolutely new to multiple imputation myself.

I did notice that SAS won't create the "parameterestimates=" output if you don't specify /solution clparms

(or only one of the two, I am not sure).

As in model y = x / solution inverse clparm

I'm still working on my code and figuring out what exactly to put. Good luck with your work!

Karen

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

ok, I was too late .

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

However, when I use exactly this code, I get:

"ERROR: The XPXI= data set can not be used with CLASS variables or effects." ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

More digging. So in the Details part of the documentation, under Input Data Sets, in the very last sentence: "Note that this combination can be used only when each effect is a continuous variable by itself." (referring to PARMS= and XPXI=).

Where I would go now. Use PROC MIXED rather than PROC GLM. This should not add any additional concerns, and will provide additional flexibility if random or repeated factors are included in the model. The options that apply then will be PARMS(CLASSVAR=FULL)= and COVB(EFFECTVAR=ROWCOL)=

So, something like:

proc mixed data = XX;

class tx_condition;

model continuous_dv = continuous_iv tx_condition/covb solution;

by _imputation_;

ods output

solutionf = glmparms

covb = glmcovb;

run;

proc mianalyze parms(classvar=full)=glmparms covb(effectvar=rowcol)=glmcovb edf=218;

/* Note the inclusion of the classvar= option to indicate that there are categorical variables */

/* Also the use of the covb option to get the covariance matrix into mianalyze */

class tx_condition;

model effects intercept continuous_iv tx_condition;

run;

Maybe this one will work better.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you both VERY MUCHfor your help. Proc mixed seems to work except that I cannot get a main effect for tx_condition from the mianalyze statement -- I only get specific comparisons to the control/reference group. Is there a way to specify things to get that overall F (and p value) for my categorical predictor tx_condition (with 3 levels). I think this is similar to the question Karen had previously.

Amy

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I know it involves the MULT option in the PROC MIANALYZE statement, but if there are multiple class variables, I am stuck. That is where the TEST statement comes in. Unfortunately, the syntax is about as clear as mud for doing the overall F test.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Dear All,

I was looking at your thread, in order to fix a similar issue I have while fitting GEE (proc genmod) via multiple imputation..mostly towards the end here I want to combine my results..I tried the solutions mentioned in the thread above but I keep getting error that "Variable GENDER is not in the PARMS= data set." although it is very well there.

Below is my code:

**proc mianalyze parms(classvar=full)=gmparms covb(effectvar=rowcol)=gmcovb edf=218;**

**class GENDER grage gr_revenu2 SM02 CARDIAC_RELATED_COND PHYSICIAN NAM PATIENT NEUROTIC_DISORDER;**

**modeleffects GENDER grage gr_revenu2 SM02 CARDIAC_RELATED_COND NEUROTIC_DISORDER **

**centred_AC centred_AQ centred_BM centred_SE ;**

**run;**

I would appreciate any help.

Thanks

Tasneem

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.