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 [[alternative HTML version deleted]]
Hi, I am trying to complete a very simple panel analysis on some bank data. Call: Formula<-plm(RoE~RoA+CAR+Inc.Dep+Cash.TL+NPL.Loans, data=Banks1, model="random", index=c("Bank.I.D.","Year")) summary(Formula) I get the following error code: ERROR: missing value where TRUE/FALSE needed Does anyone know what true/false field I am missing? Thanks, -- View this message in context: http://r.789695.n4.nabble.com/problem-with-dynformula-from-plm-package-tp867660p3782639.html Sent from the R help mailing list archive at Nabble.com.
On Thu, Sep 1, 2011 at 4:25 AM, Ash <lothlorien90 at hotmail.com> wrote:> Hi, > > I am trying to complete a very simple panel analysis on some bank data. > > Call: > Formula<-plm(RoE~RoA+CAR+Inc.Dep+Cash.TL+NPL.Loans, data=Banks1, > model="random", index=c("Bank.I.D.","Year")) > summary(Formula) > > I get the following error code: > > ERROR: > ?missing value where TRUE/FALSE needed > > Does anyone know what true/false field I am missing? >I am not sure what goes wrong, but try first to Banks1.p <- pdata.frame(Banks1, index=c("Bank.I.D.","Year") and see if that went fine, and then Banks1.fit <- plm(RoE~RoA+CAR+Inc.Dep+Cash.TL+NPL.Loans, data=Banks1.p, model="random") It may help if you posted str(Banks1) Liviu
(please reply to the list, too, as it increases your chances of getting a helpful answer) On Sat, Sep 3, 2011 at 2:51 AM, loth lorien <lothlorien90 at hotmail.com> wrote:> Hi Liviu, > > Thank you for your suggestions, but they didn't seem to work. > > I got R to estimate a fixed effects model for me: > formula<-plm(RoE~RoA+NIM+Cash.TL+CAR+NPL.Loans, data=ComBank, > model="within") > > But when I try to estimate a random effects model for a panel data set I > still get the error message:? "missing value where TRUE/FALSE needed" >I am suspecting that something may relate to the data. Do you have persistent variables that change seldom? Maybe that's causing a problem for the 'random' estimator. Is your panel balanced? If not, does it contain very few observations for some ids? To make sure that the functions work as expected on your system, try to replicate some of the examples in the 'plm' vignette. Regards Liviu> There must be something simple that I am missing, but at the moment, I can't > figure out what it is. > > Thanks again, > > Ashraf > >> From: landronimirc at gmail.com >> Date: Thu, 1 Sep 2011 10:37:57 +0200 >> Subject: Re: [R] problem with "plm" package >> To: lothlorien90 at hotmail.com >> CC: r-help at r-project.org >> >> On Thu, Sep 1, 2011 at 4:25 AM, Ash <lothlorien90 at hotmail.com> wrote: >> > Hi, >> > >> > I am trying to complete a very simple panel analysis on some bank data. >> > >> > Call: >> > Formula<-plm(RoE~RoA+CAR+Inc.Dep+Cash.TL+NPL.Loans, data=Banks1, >> > model="random", index=c("Bank.I.D.","Year")) >> > summary(Formula) >> > >> > I get the following error code: >> > >> > ERROR: >> > ?missing value where TRUE/FALSE needed >> > >> > Does anyone know what true/false field I am missing? >> > >> I am not sure what goes wrong, but try first to >> Banks1.p <- pdata.frame(Banks1, index=c("Bank.I.D.","Year") >> >> and see if that went fine, and then >> Banks1.fit <- plm(RoE~RoA+CAR+Inc.Dep+Cash.TL+NPL.Loans, >> data=Banks1.p, model="random") >> >> It may help if you posted >> str(Banks1) >> >> Liviu >-- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail