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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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