BookmarkSubscribeRSS Feed
MissPiggy
Calcite | Level 5

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;                                                                                                

run;

This runs with no errors.

Then I run the next step:

proc print data=covdata;                                                                                                               

where domain="*Subpopulation Indicator*";                                                                                           

run;                                                                                                                              

                                                                                                                                     

data covdata;                                                                                                                          

  set covdata;                                                                                                                         

  where domain="*Subpopulation Indicator*";                                                                                         

run;                                                                                                                                   

                                                                                                                                       

proc print data=parmdata;                                                                                                              

where domain="*Subpopulation Indicator*";                                                                                           

run;                                                                                                                                   

                                                                                                                                                                                                                         

data parmdata;                                                                                                                         

  set parmdata;                                                                                                                        

  where domain="*Subpopulation Indicator";                                                                                         

run;

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;                                                                                                                                                   

run;

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!

1 REPLY 1
SteveDenham
Jade | Level 19

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1096 views
  • 1 like
  • 2 in conversation