Hello. We have data, which from visual inspection, has the outcome variable (summarized over a group of counties) over time varying between levels of a dichotomous variable (PTELL), where another dichotomous variable (Growthno) = 0. But does not vary over time between levels of the same variable (PTELL) where Growthno=1. Graphs are below to demonstrate the difference.
In order to test whether there is a significant effect of PTELL (1 and 0) over time on Outcome, and if it interacts with Growthno (1 and 0), ran fixed effects model using panel data:
. * Set Outcome variable
. global Outcome RatioofSPDSchooltaxestoall
. * Set data as panel data
. sort CountyNo YearNum
. xtset CountyNo YearNum
Panel variable: CountyNo (strongly balanced)
Time variable: YearNum, 1988 to 2020
Delta: 1 unit
. xtdescribe
CountyNo: 1, 2, ..., 102 n = 81
YearNum: 1988, 1989, ..., 2020 T = 33
Delta(YearNum) = 1 unit
Span(YearNum) = 33 periods
(CountyNo*YearNum uniquely identifies each observation)
Distribution of T_i: min 5% 25% 50% 75% 95% max
33 33 33 33 33 33 33
Freq. Percent Cum. | Pattern
---------------------------+-----------------------------------
81 100.00 100.00 | 111111111111111111111111111111111
---------------------------+-----------------------------------
81 100.00 | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
. xtsum CountyNo YearNum PTELL
Variable | Mean Std. dev. Min Max | Observations
-----------------+--------------------------------------------+----------------
CountyNo overall | 52.19753 29.12861 1 102 | N = 2673
between | 29.30462 1 102 | n = 81
within | 0 52.19753 52.19753 | T = 33
| |
YearNum overall | 2004 9.523686 1988 2020 | N = 2673
between | 0 2004 2004 | n = 81
within | 9.523686 1988 2020 | T = 33
| |
PTELL overall | .3333333 .4714927 0 1 | N = 2673
between | .4743416 0 1 | n = 81
within | 0 .3333333 .3333333 | T = 33
.xtreg $Outcome PTELL Growthno, fe
note: PTELL omitted because of collinearity.
note: Growthno omitted because of collinearity.
Fixed-effects (within) regression Number of obs = 2,673
Group variable: CountyNo Number of groups = 81
R-squared: Obs per group:
Within = . min = 33
Between = . avg = 33.0
Overall = . max = 33
F(0,2592) = 0.00
corr(u_i, Xb) = . Prob > F = .
------------------------------------------------------------------------------
RatioofSPD~l | Coefficient Std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
PTELL | 0 (omitted)
Growthno | 0 (omitted)
_cons | .6630764 .0005525 1200.21 0.000 .6619931 .6641598
-------------+----------------------------------------------------------------
sigma_u | .05000966
sigma_e | .02856317
rho | .75402503 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(80, 2592) = 101.16 Prob > F = 0.0000
Both Growthno and PTELL are omitted because of collinearity. However, all tests for association between the variables show no association:
. correlate $Outcome CountyNo PTELL Growthno
(obs=2,673)
| Ratioo~l CountyNo PTELL Growthno
-------------+------------------------------------
RatioofSPD~l | 1.0000
CountyNo | 0.1827 1.0000
PTELL | 0.1888 0.1310 1.0000
Growthno | -0.0190 -0.0608 0.0000 1.0000
.
. mean $Outcome, over(PTELL)
Mean estimation Number of obs = 2,673
------------------------------------------------------------------------------------
| Mean Std. err. [95% conf. interval]
-----------------------------------+------------------------------------------------
c.RatioofSPDSchooltaxestoall@PTELL |
0 | .6554512 .0014099 .6526867 .6582157
1 | .6783269 .0016265 .6751375 .6815164
------------------------------------------------------------------------------------
.
. mean $Outcome, over(Growthno)
Mean estimation Number of obs = 2,673
---------------------------------------------------------------------------------------
| Mean Std. err. [95% conf. interval]
--------------------------------------+------------------------------------------------
c.RatioofSPDSchooltaxestoall@Growthno |
0 | .6639776 .0012925 .6614433 .6665119
1 | .6617657 .0019544 .6579335 .6655979
---------------------------------------------------------------------------------------
.
. tab PTELL Growthno
| Growthno
PTELL | 0 1 | Total
-----------+----------------------+----------
0 | 1,056 726 | 1,782
1 | 528 363 | 891
-----------+----------------------+----------
Total | 1,584 1,089 | 2,673
Also, the VIFs are 1.
. quietly regress $Outcome PTELL Growthno
.
. vif
Variable | VIF 1/VIF
-------------+----------------------
Growthno | 1.00 1.000000
PTELL | 1.00 1.000000
-------------+----------------------
Mean VIF | 1.00
I cannot figure out why there is collinearity. Or perhaps I am setting up the model wrong? Any insight would be helpful.
Array
Array
0 Response to Problems Diagnosing Collinearity
Post a Comment