BookmarkSubscribeRSS Feed
liiiiiiiib
Calcite | Level 5
Spoiler
 

all, I need your help! I'm a beginner in sas and want to do age-adjustment in my sample data. The population is devided into different agegroups according to age like 18-44, 45-64 and 65+.  But I still want to standardize the prevanlence so as to compare different prevanlence in different survey cycles. My codes are as follows:

 

PROC SURVEYREG data=diffcomcat nomcar;
STRATA sdmvstra;CLUSTER sdmvpsu;CLASS weightcat agegroup;WEIGHT wtmec12yr;DOMAIN sub;
MODEL microcat=agegroup agegroup agegroup*agegroup/noint solution vadjust=none;
ESTIMATE '18-44' agegroup 1 0 0 agegroup 0.5305 0.2992 0.1703 agegroup*agegroup 0.5305 0.2992 0.1703 0 0 0 0 0 0 /cl;
ESTIMATE "45-64" agegroup 0 1 0 agegroup 0.5305 0.2992 0.1703 agegroup*agegroup 0 0 0 0.5305 0.2992 0.1703 0 0 0 /cl;
ESTIMATE '65+' agegroup 0 0 1 agegroup 0.5305 0.2992 0.1703 agegroup*agegroup 0 0 0 0 0 0 0.5305 0.2992 0.1703/cl;
ods OUTPUT estimates=microageadj_prev_age;
*ods select ParameterEstimates Estimates;
TITLE 'Age-standardized prevalence of persons 18 years and older with microcat-age';
run;

 

and the logs are as follows:

527 PROC SURVEYREG data=diffcomcat nomcar;
528 STRATA sdmvstra;CLUSTER sdmvpsu;CLASS weightcat agegroup;WEIGHT wtmec12yr;DOMAIN sub;
529 MODEL microcat=agegroup agegroup agegroup*agegroup/noint solution vadjust=none;
530 ESTIMATE '18-44' agegroup 1 0 0 agegroup 0.5305 0.2992 0.1703 agegroup*agegroup 0.5305 0.2992 0.1703 0 0 0 0 0 0 /cl;
531 ESTIMATE "45-64" agegroup 0 1 0 agegroup 0.5305 0.2992 0.1703 agegroup*agegroup 0 0 0 0.5305 0.2992 0.1703 0 0 0 /cl;
532 ESTIMATE '65+' agegroup 0 0 1 agegroup 0.5305 0.2992 0.1703 agegroup*agegroup 0 0 0 0 0 0 0.5305 0.2992 0.1703/cl;
533 ods OUTPUT estimates=microageadj_prev_age;
534 *ods select ParameterEstimates Estimates;
535 TITLE 'Age-standardized prevalence of persons 18 years and older with microcat-age';
536 run;

WARNING: More coefficients than levels specified for effect agegroup. Some coefficients will be ignored.
NOTE: The structure of the Estimates table has changed from an earlier release of SAS.
WARNING: More coefficients than levels specified for effect agegroup. Some coefficients will be ignored.
WARNING: More coefficients than levels specified for effect agegroup. Some coefficients will be ignored.
WARNING: More coefficients than levels specified for effect agegroup. Some coefficients will be ignored.
WARNING: More coefficients than levels specified for effect agegroup. Some coefficients will be ignored.
WARNING: More coefficients than levels specified for effect agegroup. Some coefficients will be ignored.

 

 I know the third line in my code looks stupid and wired but I really don't know how to write this code。 In the output, the estimated values do not appear in the second and third groups. So who can help me ????????   Best wishes!!!!!!!!!!!

 

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
  • 0 replies
  • 424 views
  • 0 likes
  • 1 in conversation