I am estimating a hierarchical linear model using Proc GLIMMIX in SAS EG. In the class statement I have the following:
CLASS PROVID raceeth (ref='NH White') PerBlack_cat (ref='1') Foreign_cat (ref='3') LessThanHS_cat (ref='1') Poverty_cat (ref='1') Unemployment_cat (ref='1') LivingAlone65_cat (ref='1') ;
All variables are in the dataset I have specified and populated with values, yet I receive errors that the variables above with numerical reference categories are not found (see below). I am not sure what is causing these errors or how to correct them.
ERROR: Variable PERBLACK_CAT not found. ERROR: Variable FOREIGN_CAT not found. ERROR: Variable LESSTHANHS_CAT not found. ERROR: Variable POVERTY_CAT not found. ERROR: Variable UNEMPLOYMENT_CAT not found. ERROR: Variable LIVINGALONE65_CAT not found.
@kfluegge wrote:
I am estimating a hierarchical linear model using Proc GLIMMIX in SAS EG. In the class statement I have the following:
CLASS PROVID raceeth (ref='NH White') PerBlack_cat (ref='1') Foreign_cat (ref='3') LessThanHS_cat (ref='1') Poverty_cat (ref='1') Unemployment_cat (ref='1') LivingAlone65_cat (ref='1') ;
All variables are in the dataset I have specified and populated with values, yet I receive errors that the variables above with numerical reference categories are not found (see below). I am not sure what is causing these errors or how to correct them.
ERROR: Variable PERBLACK_CAT not found. ERROR: Variable FOREIGN_CAT not found. ERROR: Variable LESSTHANHS_CAT not found. ERROR: Variable POVERTY_CAT not found. ERROR: Variable UNEMPLOYMENT_CAT not found. ERROR: Variable LIVINGALONE65_CAT not found.
SAS is seldom wrong about missing variables. Make sure that the data set name used by the procedure is the one you intend.
Also it helps to post the entire procedure code along with error messages from the log. Sometimes the issue is an incorrect option or missing semicolon on a line before the one that generates errors.
Post your full code & log and check the statements before your CLASS statement. You likely made a mistake before that line making it not register properly.
@kfluegge wrote:
I am estimating a hierarchical linear model using Proc GLIMMIX in SAS EG. In the class statement I have the following:
CLASS PROVID raceeth (ref='NH White') PerBlack_cat (ref='1') Foreign_cat (ref='3') LessThanHS_cat (ref='1') Poverty_cat (ref='1') Unemployment_cat (ref='1') LivingAlone65_cat (ref='1') ;
All variables are in the dataset I have specified and populated with values, yet I receive errors that the variables above with numerical reference categories are not found (see below). I am not sure what is causing these errors or how to correct them.
ERROR: Variable PERBLACK_CAT not found. ERROR: Variable FOREIGN_CAT not found. ERROR: Variable LESSTHANHS_CAT not found. ERROR: Variable POVERTY_CAT not found. ERROR: Variable UNEMPLOYMENT_CAT not found. ERROR: Variable LIVINGALONE65_CAT not found.
There are two similar models. The first one below runs without issue. The second has the error with the class statement.
PROC GLIMMIX DATA=ANALYSIS_SES NOCLPRINT MAXLMMUPDATE=100; where nta_code not in (' ', 'QN98', 'QN99', 'BK99', 'MN99', 'BX99', 'BX98', 'SI99'); *Remove observations missing NTA or parks; CLASS PROVID; ODS OUTPUT PARAMETERESTIMATES=&EST (KEEP=EFFECT ESTIMATE STDERR); MODEL RADM30=AGE_65 MALE &MODEL_VAR /D=B LINK=LOGIT SOLUTION; *Distribution = Binary, Link = Logit; XBETA=_XBETA_; LINP=_LINP_; RANDOM INTERCEPT/SUBJECT=PROVID SOLUTION; COVTEST 'VAR(PROVID) = 0' 0 .; OUTPUT OUT=RADM30 PRED(BLUP ILINK)=PREDPROB PRED(NOBLUP ILINK)=EXPPROB PRED(BLUP)=PREDLP PRED(NOBLUP)=PREDMLP; ID XBETA LINP PROVID HICNO RADM30; NLOPTIONS TECH=NMSIMP; ods output ParameterEstimates=outRandomfile; ods output SolutionR=R.&CONDITION._solnr; ods output CovParms=R.&CONDITION._cov; covtest/wald cl; run;
PROC GLIMMIX DATA=Analysis_SES NOCLPRINT MAXLMMUPDATE=100; where nta_code not in (' ', 'QN98', 'QN99', 'BK99', 'MN99', 'BX99', 'BX98', 'SI99'); CLASS PROVID raceeth (ref='NH White') PerBlack_cat (ref='1') Foreign_cat (ref='3') LessThanHS_cat (ref='1') Poverty_cat (ref='1') Unemployment_cat (ref='1') LivingAlone65_cat (ref='1') ; ODS OUTPUT PARAMETERESTIMATES=&EST (KEEP=EFFECT ESTIMATE STDERR); MODEL RADM30=AGE_65 MALE &MODEL_VAR raceeth dualeligible &SES_Cat /D=B LINK=LOGIT SOLUTION; XBETA=_XBETA_; LINP=_LINP_; RANDOM INTERCEPT/SUBJECT=PROVID SOLUTION; COVTEST 'VAR(PROVID) = 0' 0 .; OUTPUT OUT=RADM30 PRED(BLUP ILINK)=PREDPROB PRED(NOBLUP ILINK)=EXPPROB PRED(BLUP)=PREDLP PRED(NOBLUP)=PREDMLP; ID XBETA LINP PROVID HICNO RADM30; NLOPTIONS TECH=NMSIMP; ods output ParameterEstimates=outRandomfile; ods output SolutionR=R.&CONDITION._solnr; ods output CovParms=R.&CONDITION._cov; run;
The log for the second model is included below.
24 PROC GLIMMIX DATA=Analysis_SES NOCLPRINT MAXLMMUPDATE=100; 25 where nta_code not in (' ', 'QN98', 'QN99', 'BK99', 'MN99', 'BX99', 'BX98', 'SI99'); 26 CLASS PROVID raceeth (ref='NH White') PerBlack_cat(ref='1') Foreign_cat (ref='3') LessThanHS_cat (ref='1') Poverty_cat 26 ! (ref='1') ERROR: Variable PERBLACK_CAT not found. ERROR: Variable FOREIGN_CAT not found. ERROR: Variable LESSTHANHS_CAT not found. ERROR: Variable POVERTY_CAT not found. 27 Unemployment_cat (ref='1') LivingAlone65_cat (ref='1') ; ERROR: Variable UNEMPLOYMENT_CAT not found. ERROR: Variable LIVINGALONE65_CAT not found. 28 ODS OUTPUT PARAMETERESTIMATES=&EST (KEEP=EFFECT ESTIMATE STDERR); NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE GLIMMIX used (Total process time): real time 0.00 seconds cpu time 0.00 seconds WARNING: Output 'PARAMETERESTIMATES' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used. 29 MODEL RADM30=AGE_65 MALE &MODEL_VAR raceeth dualeligible &SES_Cat 30 /D=B LINK=LOGIT SOLUTION; 31 XBETA=_XBETA_; 32 LINP=_LINP_; 33 RANDOM INTERCEPT/SUBJECT=PROVID SOLUTION; 34 OUTPUT OUT=RADM30 35 PRED(BLUP ILINK)=PREDPROB 36 PRED(NOBLUP ILINK)=EXPPROB 37 PRED(BLUP)=PREDLP 38 PRED(NOBLUP)=PREDMLP; 39 ID XBETA LINP PROVID HICNO RADM30; 40 NLOPTIONS TECH=NMSIMP; 41 ods output ParameterEstimates=outRandomfile; 42 ods output SolutionR=R.&CONDITION._solnr; 43 ods output CovParms=R.&CONDITION._cov; 44 run; 45 46 GOPTIONS NOACCESSIBLE; 47 %LET _CLIENTTASKLABEL=; 48 %LET _CLIENTPROCESSFLOWNAME=; 49 %LET _CLIENTPROJECTPATH=; 50 %LET _CLIENTPROJECTNAME=; 51 %LET _SASPROGRAMFILE=; 52 53 ;*';*";*/;quit;run; 54 ODS _ALL_ CLOSE; 55 56 57 QUIT; RUN;
Problem resolved. Data set was created using a %LET statement, so I modified the code to &ANALYSIS_SES and the code ran without error. Using proc contents helped to catch the error. thanks
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.