BookmarkSubscribeRSS Feed
MSALKAR
Calcite | Level 5

Hello, I am trying to use proc genmod for cost as my independent variable. here is my code;

 

proc genmod data=MEPS.MERGEDX;
class VARPSU(REF="1") REGION15(REF="1") SEX(REF="1") RACETHX(REF="1")
MARRY15X(REF="1") TMTKUS42(REF="1") INSCOV15(REF="1") / PARAM = REF;
MODEL COST=REGION15 AGE15X SEX RACETHX MARRY15X EDUYRDG TMTKUS42 TTLP15X INSCOV15
/ DIST=GAMMA LINK=LOG;
weight PERWT15F;
repeated subject =VARPSU(VARSTR);
run;

 

I get the error :  ERROR: Nesting of continuous variable not allowed.

I am using the MEPS dataset. Also can proc genmod in SAS account for complex sampling designs? I know it accounts for in the above procedure but I just want to double check and see if it is possible or if I need to use STATA. Thank you.

3 REPLIES 3
StatDave
SAS Super FREQ

COST is your dependent variable. All variables in the SUBJECT= effect should be CLASS variables. GENMOD does not handle survey data. 

MSALKAR
Calcite | Level 5

Sorry, yes cost is my dependent variable. Also, as per your suggestion i put the subject variables into my class statement. I still have the following warning:

NOTE: Class levels for some variables were not printed due to excessive size.
WARNING: The negative of the Hessian is not positive definite. The convergence is questionable.
WARNING: The procedure is continuing but the validity of the model fit is questionable.
WARNING: The specified model did not converge.
WARNING: Negative of Hessian not positive definite.

 

this is my code:

proc genmod data=MEPS.MERGEDX;
class VARPSU varstr;
MODEL COST=REGION15 AGE15X SEX RACETHX MARRY15X EDUYRDG TMTKUS42 TTLP15X INSCOV15
/ DIST=GAMMA LINK=LOG;
weight PERWT15F;
repeated subject =VARPSU(VARSTR);
run;

 

Shouldn't the class statement only include categorical variables? Varstr is continuous (it is the strata variable). I am very confused as to what the problem is. Also, my earlier question was that since cost is not normally distributed so we use GLM model, however since  I am using MEPS dataset which has complex sampling design, so can SAS account for complex sampling design (using strata and cluster) using proc genmod or should I use any other software? Sorry my questions may be silly, but I am new to this. Thank you.

StatDave
SAS Super FREQ

Note that you only need to specify a nested effect (or interaction) in the SUBJECT= option if you don't have a single variable that has a unique value for each cluster of repeated measures. See this note. The warnings are general messages indicating that the GEE model fitting algorithm did not properly converge. Changes to the model (usually simplifications) are generally necessary to avoid them. However, if your data are survey data, you should not be using GENMOD anyway since it does not have the proper variance estimators for survey data analysis.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 2345 views
  • 2 likes
  • 2 in conversation