Page 1 of 1

restricted regression vs unrestricted regression

Posted: Fri Jun 01, 2018 2:24 am
by user20160324
Dear Sir,

I am examining the difference of R2 from a restricted model (coeff=0) vs an unrestricted model.
For example:
Unrestricted: y = c + b1*X1 + b2*X2 + e
Restricted: b2=0

My question:
(1) What is the proper code I could apply to execute the restricted regression and find its R2?
(2) Is the R2 obtained in (1) the same as the R2 if I simply run a regression without b2: y = c + b1*X1 + e ?
i.e., if I do the following commands:
eq_ur.ls y c x1 x2
eq_r.ls y c x1
scalar r2diff=eq_ur@r2 - eq_r@r2

Such r2diff is the same if I do "restricted regression vs unrestricted regression"?

thank you so much.

Re: restricted regression vs unrestricted regression

Posted: Fri Jun 01, 2018 5:31 am
by startz
You have it corrrect.

Re: restricted regression vs unrestricted regression

Posted: Fri Jun 01, 2018 6:56 am
by user20160324
Hi startz,

Thank you. But regarding my first question:
(1) What is the proper code I could apply to execute the restricted regression and find its R2?

(under cases where it is not zero-coeff)

Thank you.

Re: restricted regression vs unrestricted regression

Posted: Fri Jun 01, 2018 7:05 am
by startz
The general case is

Code: Select all

ls (y-b2*x2) c x1


where you substitute the desired value for b2