simple linear regression for yearly trend with sample weights

Reply
New Contributor
Posts: 2

simple linear regression for yearly trend with sample weights

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

Super User
Posts: 10,500

Re: simple linear regression for yearly trend with sample weights

post some examples of the code you tried and any associated error messages.

New Contributor
Posts: 2

Re: simple linear regression for yearly trend with sample weights

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.

Super User
Posts: 10,500

Re: simple linear regression for yearly trend with sample weights

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.

Respected Advisor
Posts: 2,655

Re: simple linear regression for yearly trend with sample weights

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

Ask a Question
Discussion stats
  • 4 replies
  • 296 views
  • 0 likes
  • 3 in conversation