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,
@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.
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!
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.