BookmarkSubscribeRSS Feed
Claw
Calcite | Level 5

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

4 REPLIES 4
ballardw
Super User

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

Claw
Calcite | Level 5

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.

ballardw
Super User

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.

SteveDenham
Jade | Level 19

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 607 views
  • 0 likes
  • 3 in conversation