turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- simple linear regression for yearly trend with sam...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-08-2014 02:28 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-08-2014 05:18 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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;

weight discwt;

run;

I need to know if there is upward / downward/ neutral trend in percentage of individuals from 2002 to 2011.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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.

Steve Denham