BookmarkSubscribeRSS Feed
Tendai
Calcite | Level 5

How do I replicate this SAS SUDAAN code

proc descript data= two filetype=SAS design=WR;

 

nest _ststr _psu/missunit;

weight _statewt;

 

subgroup cancer AGEp ;

levels 2 5;

var sex;

catlevel 1;

tables cancer;

 

stdvar agep;

stdwgt 0.42026284    0.20743092    0.20203482    0.08896694   0.08130448;

print nsum wsum percent sepercent lowpct uppct/wsumfmt=f6.0 totalfmt=f10.0 style=NCHS;

rtitle "age adjusted :";

output nsum wsum total percent sepercent lowpct uppct/wsumfmt=f13.0 totalfmt=f13.0

percentfmt=f12.1 sepercentfmt=f13.0 lowpctfmt=f13.0 uppctfmt=f13.0

 

filename=cancer3 filetype=sas replace;

run;

 

I do not have SAS SUDAAN and I would like to produce the same results that come out of SAS SUDAAN with SAS. The data has a weight "statewt" and its also age adjusted to 2000 population.

 

What SAS procedure do I use to get the same results that proc descript produces. Also what test would I use to test if sex is significant in the model.

 

Thank you,

 

 

1 REPLY 1
DWilson
Pyrite | Level 9

@Tendai wrote:

How do I replicate this SAS SUDAAN code

proc descript data= two filetype=SAS design=WR;

 

nest _ststr _psu/missunit;

weight _statewt;

 

subgroup cancer AGEp ;

levels 2 5;

var sex;

catlevel 1;

tables cancer;

 

stdvar agep;

stdwgt 0.42026284    0.20743092    0.20203482    0.08896694   0.08130448;

print nsum wsum percent sepercent lowpct uppct/wsumfmt=f6.0 totalfmt=f10.0 style=NCHS;

rtitle "age adjusted :";

output nsum wsum total percent sepercent lowpct uppct/wsumfmt=f13.0 totalfmt=f13.0

percentfmt=f12.1 sepercentfmt=f13.0 lowpctfmt=f13.0 uppctfmt=f13.0

 

filename=cancer3 filetype=sas replace;

run;

 

I do not have SAS SUDAAN and I would like to produce the same results that come out of SAS SUDAAN with SAS. The data has a weight "statewt" and its also age adjusted to 2000 population.

 

What SAS procedure do I use to get the same results that proc descript produces. Also what test would I use to test if sex is significant in the model.

 

Thank you,

 

 


For what it's worth, I don't think your SUDAAN code is doing what you think it's doing.

Your code asks SUDAAN to generate the proportion of records where sex=1 (var sex; catlevel 1) by levels of the cancer variable (tables cancer), standardized by age. I would think you'd want to generate the proportion of records with cancer (var cancer), by sex (tables sex), standardized by age.

 

You can see an example in creating age-standardized estimates with SAS proc Surveyreg here:

 

https://www.cdc.gov/nchs/tutorials/NHANES/NHANESAnalyses/AgeStandardization/Task1b_SAS92.htm

 

The examples look like they will produce point estimates and standard errors but I don't see a way to statistically compare standardized estimates between groups, such as sexes. You'd have to be able to construct some combination of model parameter estimates that corresponded to that test; that you'd then specify on an ESTIMATE statement.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2438 views
  • 0 likes
  • 2 in conversation