Last active
March 18, 2017 15:00
-
-
Save jonnyrobbie/db22cdab7af6f0e0b94887970f22da4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("plm") | |
| require("nlme") | |
| data(Grunfeld) | |
| pooled.plm <- plm(inv~value+capital, data=Grunfeld, model="pooling") | |
| summary(pooled.plm) #Gujarati 16.3.1 | |
| fixed.firm.plm <- plm(inv~value+capital, data=Grunfeld, model="within", | |
| index=c("firm", "year"), effect="individual") | |
| summary(fixed.firm.plm) #Gujarati 16.3.4 | |
| fixef(fixed.firm.plm) #Gujarati 16.3.4 | |
| fixed.year.plm <- plm(inv~value+capital, data=Grunfeld, model="within", | |
| index=c("firm", "year"), effect="time") | |
| summary(fixed.year.plm) #Gujarati 16.3.6 | |
| fixef(fixed.year.plm) #Gujarati 16.3.6 | |
| random.plm <- plm(inv~value+capital, data=Grunfeld, model="random", | |
| index=c("firm", "year"), effect="individual") | |
| summary(random.plm) | |
| # {plm} nema funkce na extrakci individualnich random effecktu. Misto toho | |
| # pouziju package {nlme} | |
| random.nlme <- lme(inv~value+capital, random=~1|firm, data=Grunfeld) | |
| summary(random.nlme) #Gujarati Table 16.3 | |
| random.effects.nlme <- ranef(random.nlme) | |
| random.effects.nlme #Gujarati Table 16.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment