I have a data set that predicts the cost of a hospital stay. A patient may be seen by up to three doctors. Here are the variables:
cost hospital age diagnosis doctor1 doctor2 doctor3
Once I test the betas for doctor1-doctor3 and find no sig. diff., I want to force their betas to be the same. Here's my code:
proc reg data = hospcost;
model cost = hospital age diagnosis doctor 1 doctor2 doctor3;
restrict doctor1=doctor2=doctor3;
output out = results1 p = pred r = resid;
run;
The model runs, but at the bottom of the table of parameter estimates I see two variables called restrict. My adj-R2 is the same as when I didn't use the restrict statement. That shouldn't happen. Further, when I run a proc univariate on resid they are distributed in almost a perfect normal curve. Can anyone explain what is occurring?
Sorry to be answering my own question, but after doing some reading I think I know what's happening. In the RESTRICT staement a Lagrangian parameter is being added for each restriction. These parameters have associated standard errors, and their p-values indicate if the restrictions are not valid (low p-values).
An alternative way to specify the model would be to have a single beta for the new variable (doctor1 + doctor2 + doctor3). The results obtained from this model and the one above should be the same.
If this is not correct please let me know.
Thanks!
Came across this post and just wanted to add that the restrict statement is only testing if the lagrange multiplier is significantly different from zero. People typically ignore the estimate and p-value as they do not have much practical meaning.
To understand this multiplier you can check the following link Lagrange multiplier - Wikipedia .
The bellow SAS blog is also a great reference.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.