BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
liiiiiiiib
Calcite | Level 5

I am a student and keep getting an error when setting up estimate statements. I'm trying to build a model for the association between gender(riegendr) and ComCat. Below is the log, and I keep getting this error message "Effects used in the ESTIMATE statement must have appeared previously in the MODEL statement." I don't understand why I keep getting this - the variables 'comcat' and 'riagendr' are in the model statement. In addition, I want to output a table by "ods OUTPUT estimates=ageadj_prev2a;", but it doesnt work. Does anyone know what I'm doing wrong/can help me out?  Thanks!

 

PROC SURVEYREG data=diffcomcat nomcar;
1555 STRATA sdmvstra;
1556 CLUSTER sdmvpsu;
1557 CLASS riagendr;
1558 WEIGHT wtmec12yr;
1559 DOMAIN sub;
1560 MODEL comcat=riagendr/noint solution vadjust=none;
1561 ESTIMATE 'Male' riagendr 1 0 agegroup 0.5305 0.2992 0.1703 riagendr*agegroup 0.5305 0.2992 0.1703 0 0 0;
ERROR: Effects used in the ESTIMATE statement must have appeared previously in the MODEL statement.
NOTE: the previous statement is delete。
1562 ESTIMATE 'Female' riagendr 0 1 agegroup 0.5305 0.2992 0.1703 riagendr*agegroup 0 0 0 0.5305 0.2992 0.1703;
ERROR: Effects used in the ESTIMATE statement must have appeared previously in the MODEL statement.
NOTE: the previous statement is delete。
1563 TITLE 'Age-standardized prevalence of persons 18 years and older with comcat-sex';
1564 run;

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @liiiiiiiib and welcome to the SAS Support Communities!

 


@liiiiiiiib wrote:

1560 MODEL comcat=riagendr/noint solution vadjust=none;
1561 ESTIMATE 'Male' riagendr 1 0 agegroup 0.5305 0.2992 0.1703 riagendr*agegroup 0.5305 0.2992 0.1703 0 0 0;
ERROR: Effects used in the ESTIMATE statement must have appeared previously in the MODEL statement.


Add variable agegroup and interaction riagendr*agegroup to the MODEL statement (after riagendr) and the error message should go away. In addition, categorical variable agegroup needs to be listed in the CLASS statement.

 


@liiiiiiiib wrote:

In addition, I want to output a table by "ods OUTPUT estimates=ageadj_prev2a;", but it doesnt work.


The ODS OUTPUT statement requires one of the ODS Table Names on the left side of the equals sign. (The list of ODS table names is typically found in the "Details" section of the procedure documentation.) You probably mean parameterestimates, as there is no table estimates.

 

If you have further questions about PROC SURVEYREG, in particular regarding statistical aspects like the interpretation of results, I'd recommend that you open a new thread in the subforum Statistical Procedures.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @liiiiiiiib and welcome to the SAS Support Communities!

 


@liiiiiiiib wrote:

1560 MODEL comcat=riagendr/noint solution vadjust=none;
1561 ESTIMATE 'Male' riagendr 1 0 agegroup 0.5305 0.2992 0.1703 riagendr*agegroup 0.5305 0.2992 0.1703 0 0 0;
ERROR: Effects used in the ESTIMATE statement must have appeared previously in the MODEL statement.


Add variable agegroup and interaction riagendr*agegroup to the MODEL statement (after riagendr) and the error message should go away. In addition, categorical variable agegroup needs to be listed in the CLASS statement.

 


@liiiiiiiib wrote:

In addition, I want to output a table by "ods OUTPUT estimates=ageadj_prev2a;", but it doesnt work.


The ODS OUTPUT statement requires one of the ODS Table Names on the left side of the equals sign. (The list of ODS table names is typically found in the "Details" section of the procedure documentation.) You probably mean parameterestimates, as there is no table estimates.

 

If you have further questions about PROC SURVEYREG, in particular regarding statistical aspects like the interpretation of results, I'd recommend that you open a new thread in the subforum Statistical Procedures.

liiiiiiiib
Calcite | Level 5
Thank you very much!!!!!!!!!!!!!!!!!!!!!!!!!

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
  • 2 replies
  • 763 views
  • 1 like
  • 2 in conversation