Help using Base SAS procedures

COVB issue in PROC MIANALYZE - categorical variables not reading

New Contributor
Posts: 2

COVB issue in PROC MIANALYZE - categorical variables not reading

Hello, SAS Support,

I have read about this issue in other PROC statements and have attempted their solution but it does not seem to be applying here.

I am getting error messages that my categorical variables are not in my COVB dataset, and I'm unclear why.  I can see them on the covariance matrix generated by the earlier code (in Results Output) but once I hit the PROC MIANALYZE statement, it stops with that error message.

Here is the setup code, with ** bracketing substitutions to deidentify statements.

ods trace on;                                                                                                                          

ods graphics off;                                                                                                                      

proc surveylogistic data=**mydataset**;                                                                                               

strata *stratavariable*;                                                                                                                        

cluster *clustervariable*;                                                                                                                         

weight *weight variable*;                                                                                                                           

class race (ref='0') gender (ref='0') insurance (ref='0')  ;                                                                             

model *outcomevariable* (event='1') = race age gender educationcat2 educationcat3                                                          

educationcat4 educationcat5 insurance / covb;                          

by _imputation_;                                                                                                                       

domain *subpopulation*;                                                                                                                       

ods output covb = covdata;                                                                                                             

ods output parameterestimates=parmdata;                                                                                                


This runs with no errors.

Then I run the next step:

proc print data=covdata;                                                                                                               

where domain="*Subpopulation Indicator*";                                                                                           



data covdata;                                                                                                                          

  set covdata;                                                                                                                         

  where domain="*Subpopulation Indicator*";                                                                                         



proc print data=parmdata;                                                                                                              

where domain="*Subpopulation Indicator*";                                                                                           



data parmdata;                                                                                                                         

  set parmdata;                                                                                                                        

  where domain="*Subpopulation Indicator";                                                                                         


Again, this runs fine with no errors and all variables are in those datasets.

Then comes the proc statement -

proc mianalyze parms (classvar=level)=parmdata covb (effectvar=stacking)=covdata;        /***note:  after reading the solution to another problem, I added the (classvar=level) and (effectvar=stacking) here - running with or without both produced errors*/                                                                                                              

  modeleffects intercept race age gender educationcat2 educationcat3                                                               

                educationcat4 educationcat5 insurance;                                                                        


  test educationcat2=educationcat3=educationcat4=educationcat5=0/mult;                                                                                                                                                   


Any suggestions?  Do I need class statements in both the proc surveylogistic and the proc mianalyze steps?  do I need the CLASSVAR and EFFECTVAR statements before creation of the parmdata and covdata?

Thanks in advance for your suggestions!

Respected Advisor
Posts: 2,655

Re: COVB issue in PROC MIANALYZE - categorical variables not reading

Posted in reply to MissPiggy

I think that if we have learned anything about PROC MIANALYZE and class variables, it that Tech Support is the order of the day here.  Perhaps they will finally get in touch with the developers and get a hotfix for MIANALYZE so that it will correctly handle class variables.  Or at least get some examples in the documentation that correctly show how to do this.

I would almost venture a guess that PROC SURVEYLOGISTIC uses a different parameter name than does GENMOD or GLM.

Steve Denham

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation