Hi All,
I am beginner user for SAS. I have large pubic data with multiple variables including sample weights. I am trying to do simple linear regression to check for yearly trends in mortality.
my question will be "trends in mortality over time".
my extracted data has variables 'year', 'died' (0=alive, 1=died) and 'weight'(sample weight). I am planning to use proc surveyreg but can't seem to get SAS code right. Please help.
my data looks like as follow (around 5,00,000 observations in dataset)
year died weight
2002 0 4.3383
2002 1 5.1405
2003 1 5.2034
.
.
.
2011 0 5.9179
2011 1 4.9550
I am looking for something as follows (below is the example from the different article and I am looking for similar analysis)
Thanks in advance
Claw
post some examples of the code you tried and any associated error messages.
i tried the following code. It seems completely wrong because 'died' is categorical variable.
proc surveyreg data=allibd;
model died=year / solution;
weight discwt;
run;
I need to know if there is upward / downward/ neutral trend in percentage of individuals from 2002 to 2011.
It looks like you may need to summarize the data to get PERCENT of the category of interes to model. Don't forget to accumulate the weights if so.
Rather than SURVEYREG, you should look at SURVEYLOGISTIC as a method. The examples in the documentation reference more than two categorical levels, but it should not be a problem to reduce the complexity in those examples to what you are doing.
Steve Denham
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.