question about fixed and random effects

Questions related to panel (pooled cross-section time series) data.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

question about fixed and random effects

Unread post by jack »

Dear Tom
I have a sample of 5000 households’ expenditures on a commodity (x) for 10 years (1991 to 2000). At first I calcify those households into 10 income levels (or deciles) and then I sum their expenditures on the commodity for each year. Therefore I have a panel sample of ten cross sections and 10 years (10 observations for each year and 100 total observations). And at year 6 (i.e., 1996) a policy change has occurred in the country which could have affected the consumption behavior of households.
Now I want to estimate the following panel model:
c(i,t)=a(i)+b*M(t)
In which, c(i,t) is expenditure of cross i in year t on the commodity and M is total expenditures of cross i in year t.

The question is which model is more appropriate: fixed effect or random effect? And one-way or two-way error model?
I have some information about fixed and random effect but I am not sure how to choose appropriate model intuitively. For example I am not sure is a RE two-way error or RE mixed effect (fixed cross effects and random time effects) correct or not intuitively. I think there are time-specific effects because of policy change but I am not sure it is fixed or random.
I would be grateful if you could possibly guide me.
Last edited by jack on Tue Sep 03, 2019 4:31 pm, edited 1 time in total.
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

I assume you meant (from the description) M(i,t).

That sounds like fixed effects would be proper. The difference between the two is that random effects assumes the individual effect is uncorrelated with the regressor M, while fixed effects makes no such assumption.

Adding time effects means that you think there is an unmodeled common change in consumption over time (in some way). It sounds like what you really want is a one-off change at the intervention point, either with an intercept change, a slope change or both. If you incorporate time effects, you would be unable to estimate an dummy variable intercept change.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Thanks a lot for your guidance.
That sounds like fixed effects would be proper
.

Since my sample (5000 households) is a small part of the population and I am interested in the population itself , therefore I thought RE model may be more appropriate.
Adding time effects means that you think there is an unmodeled common change in consumption over time (in some way)
.

Consumption expenditures are rising because of inflation and c(i,t) and M(i,t) are both nominal variables so they are some how increasing each year. And the policy change has increased the inflation from 2005 onwards.
So, is it a good reason to add times effect? (or just use a time dummy for 2005 onwards?).
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

jack wrote:Thanks a lot for your guidance.
That sounds like fixed effects would be proper
.

Since my sample (5000 households) is a small part of the population and I am interested in the population itself , therefore I thought RE model may be more appropriate.
No. I have no idea where you got that idea.
jack wrote:
Adding time effects means that you think there is an unmodeled common change in consumption over time (in some way)
.

Consumption expenditures are rising because of inflation and c(i,t) and M(i,t) are both nominal variables so they are some how increasing each year. And the policy change has increased the inflation from 2005 onwards.
So, is it a good reason to add times effect? (or just use a time dummy for 2005 onwards?).
Why are you not deflating the expenditure variables? That makes more sense than adding time effects. Note that the individual effects are assumed to be constant over time, which certainly would not be the case if the data are increasing with inflation.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Note that the individual effects are assumed to be constant over time, which certainly would not be the case if the data are increasing with inflation.
Why?

Is it ok to use deflated expenditure variables in following system?
Image

where p(1,t)*x(1,t) is consumption expenditures on x(1) in year t, m(t) total expenditures and p(1) the price of x(1) and so on.
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

jack wrote:
Note that the individual effects are assumed to be constant over time, which certainly would not be the case if the data are increasing with inflation.
Why?
Why what?
jack wrote: Is it ok to use deflated expenditure variables in following system?
Image

where p(1,t)*x(1,t) is consumption expenditures on x(1) in year t, m(t) total expenditures and p(1) the price of x(1) and so on.
If you divide both by a general price level p(t), aren't all the decisions the same?
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Thanks a lot for your kind replies.
Why what?
Why the assumption that fixed effect are constant over time will be violated if the data are increasing with inflation?

If I use real or deflated data, so shouldn't I include time effects (period effects) in the model? Do I need just a dummy variable for policy change?

And the last question. Based on your advice it seems that the appropriate model is a fixed effects model. why? Is it because the individual effect is probably correlated with the regressor M? And, what if the results of Hausman test show that the appropriate model is a random effect model (for both cross and time effects)?

I am really sorry for asking too many equations.
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

jack wrote:Thanks a lot for your kind replies.
Why what?
Why the assumption that fixed effect are constant over time will be violated if the data are increasing with inflation?
Think about it. An individual effect is fixed over time. How could that possibly work with nominal expenditures going up with inflation?
jack wrote: If I use real or deflated data, so shouldn't I include time effects (period effects) in the model? Do I need just a dummy variable for policy change?
If you use deflated data, you're getting rid of an obvious difference between time periods. That doesn't mean that time effects might not be present but they are definitely present if you use nominal data.
jack wrote: And the last question. Based on your advice it seems that the appropriate model is a fixed effects model. why? Is it because the individual effect is probably correlated with the regressor M? And, what if the results of Hausman test show that the appropriate model is a random effect model (for both cross and time effects)?
Fixed effects is never really wrong, unless you have an interest in a coefficient on a time invariant regressor. A Hausman test will never show the "appropriate" model is RE; it can just reject RE.

Is your base model actually intended to be used with panel data? It looks more like it's a cross section model.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Dear Tom

As you said before here https://estima.com/forum/viewtopic.php? ... 284#p16890 my goal is to estimate a LES as follows:
Image.

I tried to write a program based on consumer.rpf but I couldn't get appropriate results.
Now, I want to estimate Imageand get estimated a(i)'s from it and then substitute them in LES and finally estimate LES with SUR.

Here is my data (nominal data).
rats.xlsx
(21.52 KiB) Downloaded 1297 times
I don't know how to justify that FE is a proper model and I don't know if I still need to include time effects or a time dummy variable even with deflated data.

Think about it. An individual effect is fixed over time. How could that possibly work with nominal expenditures going up with inflation?
I still didn't get the point :(
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

Was your original model designed to be estimated with panel data, or was it designed to be estimated with cross section data? You can't just take a cross section model and replace i subscripts with i,t and have a sensible panel data model, as the original model may not be designed to handle things that change with time.
Think about it. An individual effect is fixed over time. How could that possibly work with nominal expenditures going up with inflation?
jack wrote:I still didn't get the point :(
An individual effect is a individual-specific shift up or down from what a model predicts. If you do the model in nominal expenditures, that means something like +$40. If the prices triple, do you really think the person would still be just +$40?
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Dear Tom,

The results for random and fixed effect are very different. Here is the results for regression of real c1(cc) on real m(mm). I do not know how to choose the proper model. As you can see the coefficients of mm are different.

Panel Regression - Estimation by Random Effects
Dependent Variable CC
Panel(10) of Annual Data From      1//1981:01 To     10//1990:01
Usable Observations                       100
Degrees of Freedom                         98
Mean of Dependent Variable       202660.97274
Std Error of Dependent Variable   80192.83543
Standard Error of Estimate        17291.53222
Sum of Squared Residuals          29301714490
Log Likelihood                     -1134.4761
S.D. (eta_it)                      18137.1435
S.D. (mu_i)                            0.0000
S.D. (lambda_t)                    18767.0717
Hausman Test(1)                      0.316016
Significance Level                  0.5740119

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                     19930.876270  7774.031387      2.56378  0.01035403
2.  MM                               0.200246     0.005131     39.02414  0.00000000


Panel Regression - Estimation by Fixed Effects
Dependent Variable CC
Panel(10) of Annual Data From      1//1981:01 To     10//1990:01
Usable Observations                       100
Degrees of Freedom                         89
Centered R^2                        0.9306315
R-Bar^2                             0.9228373
Uncentered R^2                      0.9906902
Mean of Dependent Variable       202660.97274
Std Error of Dependent Variable   80192.83543
Standard Error of Estimate        22276.10952
Sum of Squared Residuals          44164029908
Regression F(10,89)                  119.4003
Significance Level of F             0.0000000
Log Likelihood                     -1137.1942

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                     0.0000000000 0.0000000000      0.00000  0.00000000
2.  MM                           0.1393393002 0.0084459733     16.49772  0.00000000
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

Your RE is doing EFFECTS=BOTH and your FE isn't.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Dear Tom,

Here are the results of three models.
I do not know how to choose between them.
Hasuman test cannot reject the RE.
Results of model one and two and three are very similar.
Under the the policy change the subsidies on energy and food prices has been replaced with monthly cash payments to households ( from year 6 onwards).

So, I am really grateful if you could possibly guide me to choose the proper model.

Model 1:
PREG(METHOD=RANDOM,EFFECTS=BOTH) CC
# Constant MM

Panel Regression - Estimation by Random Effects
Dependent Variable CC
Panel(10) of Annual Data From      1//1981:01 To     10//1990:01
Usable Observations                       100
Degrees of Freedom                         98
Mean of Dependent Variable       202660.97274
Std Error of Dependent Variable   80192.83543
Standard Error of Estimate        17291.53222
Sum of Squared Residuals          29301714490
Log Likelihood                     -1134.4761
S.D. (eta_it)                      18137.1435
S.D. (mu_i)                            0.0000
S.D. (lambda_t)                    18767.0717
Hausman Test(1)                      0.316016
Significance Level                  0.5740119

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                     19930.876270  7774.031387      2.56378  0.01035403
2.  MM                               0.200246     0.005131     39.02414  0.00000000
Model 2:
PREG(METHOD=FIXED,EFFECTS=TIME) CC
# Constant MM

Panel Regression - Estimation by Fixed Effects
Dependent Variable CC
Panel(10) of Annual Data From      1//1981:01 To     10//1990:01
Usable Observations                       100
Degrees of Freedom                         89
Centered R^2                        0.9546383
R-Bar^2                             0.9495415
Uncentered R^2                      0.9939121
Mean of Dependent Variable       202660.97274
Std Error of Dependent Variable   80192.83543
Standard Error of Estimate        18013.69101
Sum of Squared Residuals          28879882673
Regression F(10,89)                  187.3009
Significance Level of F             0.0000000
Log Likelihood                     -1115.9559

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                     0.0000000000 0.0000000000      0.00000  0.00000000
2.  MM                           0.2031902648 0.0052015146     39.06367  0.00000000
model 3:
PREG(METHOD=FIXED,EFFECTS=BOTH) CC
# Constant MM

Panel Regression - Estimation by Fixed Effects
Dependent Variable CC
Panel(10) of Annual Data From      1//1981:01 To     10//1990:01
Usable Observations                       100
Degrees of Freedom                         80
Centered R^2                        0.9586647
R-Bar^2                             0.9488475
Uncentered R^2                      0.9944525
Mean of Dependent Variable       202660.97274
Std Error of Dependent Variable   80192.83543
Standard Error of Estimate        18137.14354
Sum of Squared Residuals          26316478051
Regression F(19,80)                   97.6521
Significance Level of F             0.0000000
Log Likelihood                     -1111.3084

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                     0.0000000000 0.0000000000      0.00000  0.00000000
2.  MM                           0.1909839721 0.0172557848     11.06782  0.00000000

Model 4:
PREG(method=fixed) CC
# Constant MM

anel Regression - Estimation by Fixed Effects
Dependent Variable CC
Panel(10) of Annual Data From      1//1981:01 To     10//1990:01
Usable Observations                       100
Degrees of Freedom                         89
Centered R^2                        0.9306315
R-Bar^2                             0.9228373
Uncentered R^2                      0.9906902
Mean of Dependent Variable       202660.97274
Std Error of Dependent Variable   80192.83543
Standard Error of Estimate        22276.10952
Sum of Squared Residuals          44164029908
Regression F(10,89)                  119.4003
Significance Level of F             0.0000000
Log Likelihood                     -1137.1942

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                     0.0000000000 0.0000000000      0.00000  0.00000000
2.  MM                           0.1393393002 0.0084459733     16.49772  0.00000000
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: question about fixed and random effects

Unread post by TomDoan »

There's no indication that you have individual effects; just time effects. RE and FE with just EFFECTS=TiME look like they should give fairly similar results.
jack
Posts: 160
Joined: Tue Sep 27, 2016 11:44 am

Re: question about fixed and random effects

Unread post by jack »

Thanks a lot.

And, why R-Bar^2 is so high in those panel models? Is it a sign of spurious regression?
Post Reply