restricted regression vs unrestricted regression

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

user20160324
Posts: 4
Joined: Wed Mar 23, 2016 8:26 am

restricted regression vs unrestricted regression

Postby user20160324 » Fri Jun 01, 2018 2:24 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: restricted regression vs unrestricted regression

Postby startz » Fri Jun 01, 2018 5:31 am

You have it corrrect.

user20160324
Posts: 4
Joined: Wed Mar 23, 2016 8:26 am

Re: restricted regression vs unrestricted regression

Postby user20160324 » Fri Jun 01, 2018 6:56 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: restricted regression vs unrestricted regression

Postby startz » Fri Jun 01, 2018 7:05 am

The general case is

Code: Select all

ls (y-b2*x2) c x1


where you substitute the desired value for b2


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 12 guests