regression analysis - use of "if" and "else" commands
Posted: Thu Oct 08, 2020 11:05 pm
Hello Eviews forum members,
I am trying to run an OLS regression that needs to get the coefficients depends on the values of let's say variable s (s can be 0 and 1);
1) When I run OLS regression like below I kind of getting not correct coefficients
y c X1 (s=1) X1 (s=0)
which is not what I want.
2) when I put "if s=1" in sample section (i.e., 1/01/2001 9/09/2019 if s = 1) then I am getting correct results but I cannot have both if s=1 and if s=0 in one go.
I tried if else commands and some other options, I got errors.
The reason that I want all the coefficient in one run is because later I need to test a hypothesis that the two coefficient are equal (wald test).
I am trying it using "quick" tab -> estimate equation but later I will write the codes since I have 100 regressions to run.
Any help would be appreciated.
I am trying to run an OLS regression that needs to get the coefficients depends on the values of let's say variable s (s can be 0 and 1);
1) When I run OLS regression like below I kind of getting not correct coefficients
y c X1 (s=1) X1 (s=0)
which is not what I want.
2) when I put "if s=1" in sample section (i.e., 1/01/2001 9/09/2019 if s = 1) then I am getting correct results but I cannot have both if s=1 and if s=0 in one go.
I tried if else commands and some other options, I got errors.
The reason that I want all the coefficient in one run is because later I need to test a hypothesis that the two coefficient are equal (wald test).
I am trying it using "quick" tab -> estimate equation but later I will write the codes since I have 100 regressions to run.
Any help would be appreciated.