Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

Estimating within-between model specification using plm

$
0
0

Is it possible to include one time-invariant variable in a two-way fixed effects model in plm?

Model set up:

`m3 <- plm(habi5 ~ habi1 + habi3 + econ1 + gov1 + gov2 + gov3 + gov4 + soci1 + soci3 + soci4,
          data = merge3,
          index=c("Name", "Year"),
          model="within",
          effect = "twoways")`

"habi1" is a time-invariant variable and its estimate does not show up the summary

> summary(m3)
    Twoways effects Within Model

    Call:
    plm(formula = habi5 ~ habi1 + habi3 + econ1 + gov1 + gov2 + gov3 + 
        gov4 + soci1 + soci3 + soci4, data = merge3, effect = "twoways", 
        model = "within", index = c("Name", "Year"))

    Balanced Panel: n = 103, T = 23, N = 2369

    Residuals:
           Min.     1st Qu.      Median     3rd Qu.        Max. 
    -0.19465878 -0.01498387 -0.00050656  0.01723336  0.20209069 

    Coefficients:
            Estimate Std. Error t-value      Pr(>|t|)    
    habi3  0.0440352  0.0273546  1.6098      0.107585    
    econ1 -0.1178293  0.0211307 -5.5762 0.00000002755 ***
    gov1  -0.0056041  0.0149073 -0.3759      0.707002    
    gov2  -0.0623383  0.0230207 -2.7079      0.006822 ** 
    gov3   0.0522537  0.0248725  2.1009      0.035765 *  
    gov4  -0.0726637  0.0306695 -2.3692      0.017909 *  
    soci1  0.0512043  0.0176959  2.8936      0.003846 ** 
    soci3  0.0653222  0.0140361  4.6539 0.00000344837 ***
    soci4 -0.0418018  0.0104464 -4.0015 0.00006498113 ***
    ---
    Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

    Total Sum of Squares:    3.3689
    Residual Sum of Squares: 3.1978
    R-Squared:      0.050797
    Adj. R-Squared: -0.0056884
    F-statistic: 13.2896 on 9 and 2235 DF, p-value: < 0.000000000000000222

Is there a way to estimate the effect of this variable in in my current model specification using plm?

EDIT:

Here is a glimpse of the data structure:

> str(merge3)
'data.frame':   4416 obs. of  55 variables:
 $ ISO3       : Factor w/ 192 levels "AFG","AGO","ALB",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ Name       : Factor w/ 192 levels "Afghanistan",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ Year       : Factor w/ 23 levels "1995","1996",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ Exposure   : num  0.481 0.481 0.481 0.481 0.481 ...
 $ Sensitivity: num  0.497 0.498 0.498 0.499 0.499 ...
 $ Capacity   : num  0.893 0.891 0.889 0.883 0.876 ...
 $ Economic   : num  0.138 0.138 0.138 0.138 0.138 ...
 $ Governance : num  0.139 0.139 0.143 0.147 0.142 ...
 $ Social     : num  0.297 0.297 0.297 0.297 0.297 ...
 $ food1      : num  0.702 0.702 0.702 0.702 0.702 ...
 $ food2      : num  0.439 0.439 0.439 0.439 0.439 ...
 $ food3      : num  0.779 0.779 0.779 0.779 0.779 ...
 $ food4      : num  0.845 0.844 0.843 0.842 0.841 ...
 $ food5      : num  0.988 0.988 0.988 0.988 0.988 ...
 $ food6      : num  0.7 0.7 0.7 0.647 0.595 ...
 $ water1     : num  0.442 0.442 0.442 0.442 0.442 ...
 $ water2     : num  0.179 0.179 0.179 0.179 0.179 ...
 $ water3     : num  0.436 0.436 0.436 0.436 0.436 ...
 $ water4     : num  0.287 0.287 0.287 0.287 0.287 ...
 $ water5     : num  0.986 0.986 0.986 0.986 0.986 ...
 $ water6     : num  0.975 0.953 0.932 0.909 0.888 ...
 $ heal1      : num  0.667 0.667 0.667 0.667 0.667 ...
 $ heal2      : num  1 1 1 1 1 1 1 1 1 1 ...
 $ heal3      : num  0.143 0.143 0.143 0.143 0.143 ...
 $ heal4      : num  0.646 0.646 0.646 0.646 0.646 ...
 $ heal5      : num  0.99 0.99 0.99 0.99 0.99 ...
 $ heal6      : num  0.819 0.813 0.807 0.802 0.796 ...
 $ ecos1      : num  0.659 0.659 0.659 0.659 0.659 ...
 $ ecos2      : num  0 0 0 0 0 0 0 0 0 0 ...
 $ ecos3      : num  NA NA NA NA NA NA NA NA NA NA ...
 $ ecos4      : num  0.2 0.2 0.2 0.2 0.2 ...
 $ ecos5      : num  0.885 0.885 0.885 0.885 0.885 ...
 $ ecos6      : num  0.835 0.84 0.845 0.846 0.846 ...
 $ habi1      : num  0.0727 0.0727 0.0727 0.0727 0.0727 ...
 $ habi2      : num  0.645 0.645 0.645 0.645 0.645 ...
 $ habi3      : num  0.216 0.217 0.218 0.219 0.22 ...
 $ habi4      : num  0.92 0.925 0.93 0.934 0.936 ...
 $ habi5      : num  1 1 1 1 1 1 1 1 1 1 ...
 $ habi6      : num  0.827 0.827 0.827 0.827 0.827 ...
 $ infr1      : num  NA NA NA NA NA NA NA NA NA NA ...
 $ infr2      : num  NA NA NA NA NA NA NA NA NA NA ...
 $ infr3      : num  NA NA NA NA NA NA NA NA NA NA ...
 $ infr4      : num  NA NA NA NA NA NA NA NA NA NA ...
 $ infr5      : num  1 1 1 1 0.998 ...
 $ infr6      : num  0.713 0.713 0.713 0.713 0.713 ...
 $ econ1      : num  0.138 0.138 0.138 0.138 0.138 ...
 $ gov1       : num  0.155 0.155 0.154 0.153 0.152 ...
 $ gov2       : num  0.132 0.132 0.145 0.157 0.144 ...
 $ gov3       : num  0.108 0.108 0.108 0.108 0.106 ...
 $ gov4       : num  0.16 0.16 0.165 0.17 0.166 ...
 $ soci1      : num  0.701 0.701 0.701 0.701 0.701 ...
 $ soci2      : num  0.18 0.18 0.18 0.18 0.18 ...
 $ soci3      : num  0.00816 0.00816 0.00816 0.00816 0.00816 ...
 $ soci4      : num  NA NA NA NA NA NA NA NA NA NA ...
 $ gdp        : num  860 860 860 860 860 ...

Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>