BookmarkSubscribeRSS Feed
DocMartin
Quartz | Level 8

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?

2 REPLIES 2
DocMartin
Quartz | Level 8

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! 

JoséQ
SAS Employee

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.

Restricted least squares regression in SAS - The DO Loop

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1503 views
  • 2 likes
  • 2 in conversation