07-08-2014 02:28 PM
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
07-08-2014 10:23 PM
i tried the following code. It seems completely wrong because 'died' is categorical variable.
proc surveyreg data=allibd;
model died=year / solution;
I need to know if there is upward / downward/ neutral trend in percentage of individuals from 2002 to 2011.
07-09-2014 10:32 AM
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.
07-09-2014 11:07 AM
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.