Owen Powell
2009-Nov-27 15:25 UTC
[R] problem with "dynformula" from "plm" package [RE-POST]
Hello list, I'm following the paper (http://www.jstatsoft.org/v27/i02/paper) on how to use "plm" to run panel regressions, and am having trouble with what I believe should be something very basic. When I run the command (p.9 in the paper): R> dynformula(emp~wage+capital,log=list(capital=FALSE,TRUE),lag=list(emp=2,c(2,3)),diff=list(FALSE,capital=TRUE)) I see: emp ~ wage + capital rather than the complete model that is given in the paper: log(emp) ~ lag(log(emp), 1) + lag(log(emp), 2) + lag(log(wage), 2) + lag(log(wage), 3) + diff(capital, 2) + diff(capital, 3) And indeed, when I try to run a regression using that formula, it appears to not contain any lags or logs (output below). Any ideas? Thanks in advance, ~Owen -- Owen Powell http://center.uvt.nl/phd_stud/powell R> library("plm") R> data("EmplUK", package="plm") R> a dynformula(emp~wage+capital,log=list(capital=FALSE,TRUE),lag=list(emp=2,c(2,3)),diff=list(FALSE,capital=TRUE)) R> testModel <- plm(formula = a,data=EmplUK,model="within") [1] 1031 2 R> summary(testModel) Oneway (individual) effect Within Model Call: plm(formula = a, data = EmplUK, model = "within") Unbalanced Panel: n=140, T=7-9, N=1031 Residuals : Min. 1st Qu. Median 3rd Qu. Max. -17.1000 -0.3060 0.0137 0.3070 27.3000 Coefficients : Estimate Std. Error t-value Pr(>|t|) wage -0.143626 0.032790 -4.3802 1.186e-05 *** capital 0.801495 0.064088 12.5062 < 2.2e-16 *** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Total Sum of Squares: 5030.6 Residual Sum of Squares: 4207.8 F-statistic: 86.9179 on 2 and 889 DF, p-value: < 2.22e-16
David Winsemius
2009-Nov-27 15:41 UTC
[R] problem with "dynformula" from "plm" package [RE-POST]
On Nov 27, 2009, at 10:25 AM, Owen Powell wrote:> Hello list, > > I'm following the paper (http://www.jstatsoft.org/v27/i02/paper) on > how to use "plm" to run panel regressions, and am having trouble with > what I believe should be something very basic. > > When I run the command (p.9 in the paper): > > R> > dynformula(emp~wage > + > capital > ,log > = > list > (capital > =FALSE,TRUE),lag=list(emp=2,c(2,3)),diff=list(FALSE,capital=TRUE)) >Perhaps you could have read the help page for the current version of the package which says the argument have been modified. Using the current arguments: dynformula(emp~wage + capital ,log .form = list (capital = FALSE ,TRUE),lag.form=list(emp=2,c(2,3)),diff.form=list(FALSE,capital=TRUE)) log(emp) ~ lag(log(emp), 1) + lag(log(emp), 2) + lag(log(emp), 1) + lag(log(emp), 2) + lag(log(wage), 2) + lag(log(wage), 3) + diff(capital, 2) + diff(capital, 3) -- David Winsemius, MD> I see: > > emp ~ wage + capital > > rather than the complete model that is given in the paper: > > log(emp) ~ lag(log(emp), 1) + lag(log(emp), 2) + lag(log(wage), 2) + > lag(log(wage), 3) + diff(capital, 2) + diff(capital, 3) > > And indeed, when I try to run a regression using that formula, it > appears to not contain any lags or logs (output below). > > Any ideas? Thanks in advance, > > ~Owen > > -- > Owen Powell > http://center.uvt.nl/phd_stud/powell > > R> library("plm") > R> data("EmplUK", package="plm") > R> a > dynformula(emp~wage > + > capital > ,log > = > list > (capital > =FALSE,TRUE),lag=list(emp=2,c(2,3)),diff=list(FALSE,capital=TRUE))snipped David Winsemius, MD Heritage Laboratories West Hartford, CT