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
- /
- Base SAS Programming
- /
- Change in parameter estimates in logistic regressi...

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

03-05-2016 10:09 PM

Hello,

I need some help with this problem i am trying to solve. I am running a logistic regresssion model. After running the full model, i removed one variable from the full model. I want to see how removing that one variable affected the betas (parameter estimates) of the other variables in the model.

I will be very grateful if i can get an answer to this.

Thanks

Accepted Solutions

Solution

03-05-2016
11:21 PM

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

Posted in reply to Reeza

03-05-2016 11:21 PM

I modified the solution you gave and it worked perfectly well. Thank you so much for your input Reeza.

Below is the complete code for anyone with similar problem:

```
/*1*/
ods table parameterestimates=model1;
proc logistic data=temp;
class sex race hospital snf;
model read=sex race hospital snf;
run;
ods table parameterestimates=model2;
proc logistic data=temp;
class sex race hospital;
model read=sex race hospital;
run;
proc sort data=model1;
by variable;
proc sort data=model2;
by variable;
run;
data comparison;
/*2*/
merge model1 (Rename=estimate=estimate1)
model2 (rename=estimate=estimate2);
by variable;
/*3*/
diff=((estimate1-estimate2)/estimate2)*100;
run;
proc print data=comparison;
run;
```

All Replies

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

Posted in reply to atijjani

03-05-2016 10:14 PM

Sorry, It's unclear what your question is. If you have a question on code, please include your current code.

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

Posted in reply to Reeza

03-05-2016 10:38 PM

Thank you for your response.

Assuming that i have a logisic regression model with the full model below:

proc logistic data=temp;

class sex race hospital snf;

model read=sex race hospital snf;

run;

and then i reduced model as below (it is without the variable snf)

proc logistic data=temp;

class sex race hospital;

model read=sex race hospital;

run;

I want to see how removing snf from the full model changed the betas (parameter estimates) for other variables in the reduced model.

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

Posted in reply to atijjani

03-05-2016 10:38 PM

In other words, i want to check for potential confounding effect of snf.

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

Posted in reply to atijjani

03-05-2016 10:48 PM

- Capture the parameterEstimates from each table
- Merge tables together - rename estimate variable - I can't remember what it's called at the moment. If you don't rename the variable will overwrite and you won't get valid values.
- Calculate the difference

```
/*1*/
ods table parameterestimates=model1;
proc logistic data=temp;
class sex race hospital snf;
model read=sex race hospital snf;
run;
ods table parameterestimates=model2;
proc logistic data=temp;
class sex race hospital snf;
model read=sex race hospital;
run;
data comparison;
/*2*/
merge model1 (Rename=estimate=estimate1)
model2 (rename=estimate=estimate2);
by variable;
/*3*/
diff=estimate1-estimate2;
run;
```

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

Posted in reply to Reeza

03-05-2016 10:57 PM

Thank you so much. Let me see if it works

Solution

03-05-2016
11:21 PM

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

Posted in reply to Reeza

03-05-2016 11:21 PM

I modified the solution you gave and it worked perfectly well. Thank you so much for your input Reeza.

Below is the complete code for anyone with similar problem:

```
/*1*/
ods table parameterestimates=model1;
proc logistic data=temp;
class sex race hospital snf;
model read=sex race hospital snf;
run;
ods table parameterestimates=model2;
proc logistic data=temp;
class sex race hospital;
model read=sex race hospital;
run;
proc sort data=model1;
by variable;
proc sort data=model2;
by variable;
run;
data comparison;
/*2*/
merge model1 (Rename=estimate=estimate1)
model2 (rename=estimate=estimate2);
by variable;
/*3*/
diff=((estimate1-estimate2)/estimate2)*100;
run;
proc print data=comparison;
run;
```

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

Posted in reply to atijjani

03-05-2016 11:32 PM

Use backward seletion + include= option.

```
data class;
set sashelp.class;
if _n_ in (1:9) then y=1;
else y=0;
run;
proc logistic data=class;
class sex;
model y(event='1')= sex age weight height/details selection=backward include=3;
run;
```