BookmarkSubscribeRSS Feed
astudent
Calcite | Level 5

Hello,

 

I am running both simple linear regression and multiple linear regression using proc surveyreg. I have 2 types of variables: Total score (continuous dependent variable) and Q (binary independent variable coded as 0=negative response and 1=affirmative response) the log looks alright, there is no error message or any special note. I was expecting to get regression coefficients table which I got but instead of one coefficient for each independent variable, I keep getting 2 coefficients (one for 0 and another for 1). I want SAS to use the negative responses as the reference group and give me the coefficients for the affirmative responses. 

In addition, I want to do a backwards selection multiple linear regression. I have tried to add this specification in the code as it is usually done in the proc reg procedure but it is not working. If I could get ideas on how to do this procedure for complex data, I would greatly appreciate. 

 

Here is a screenshot of the coefficients table I am getting for multiple linear regression: 

astudent_0-1704314141558.png

 

This is the reference code from which I derived my multiple linear regression code: 

 

PROC SURVEYREG data=analysis_data nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
WEIGHT wtmec4yr;
CLASS  sex ethn smoker dmdeduc bmicatf;
DOMAIN eligible;
MODEL  lbdhdl= sex ethn ridageyr smoker dmdeduc smoker bmicatf/solution;
run;  

Here is a screenshot of the simple linear regression results:

Here is a screenshot of the simple linear regression results:

astudent_2-1704314764681.png

 

 

Here is the reference code I used for the simple linear regression: 

PROC SURVEYREG data=analysis_data nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
WEIGHT wtmec4yr;
CLASS   bmicatf;
DOMAIN eligible;
MODEL   lbdhdl= bmicatf/ solution;
run;  

 

1 REPLY 1
ballardw
Super User

Suggestion when asking questions about output: Reference your variable names not what the variable means to you. You do not have anything in the code that shows a Q. So we have absolutely no idea which would be affected.

 

You would specify the reference level in the Class statement. For a specific variable it would look like:

Class somevar (ref='0')

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 324 views
  • 1 like
  • 2 in conversation