Re: [R] Marginal effects with plm

2018-09-06 Thread Fox, John
la(), which is from the plm package. It would probably require substantial effort to get this to work. Best, John > -Original Message- > From: Miluji Sb [mailto:miluj...@gmail.com] > Sent: Thursday, September 6, 2018 8:52 AM > To: Fox, John > Cc: r-help mailing list >

Re: [R] Marginal effects with plm

2018-09-06 Thread Miluji Sb
Dear Ista, Thanks for your reply. I tried both "prediction" and "margins" but neither of them seem to work with plm. Sincerely, Milu On Thu, Sep 6, 2018 at 3:04 PM Ista Zahn wrote: > You might be interested in the "prediction" and "margins" packages. > > --Ista > > On Wed, Sep 5, 2018 at 6:3

Re: [R] Marginal effects with plm

2018-09-06 Thread Ista Zahn
You might be interested in the "prediction" and "margins" packages. --Ista On Wed, Sep 5, 2018 at 6:30 PM Miluji Sb wrote: > > Dear all, > > I am running the following panel regression; > > plm1 <- plm(formula = log(y) ~ x1 + I(x1^2) + heat*debt_dummy + tt, data = > df, index=c("region","year"))

Re: [R] Marginal effects with plm

2018-09-06 Thread Miluji Sb
Dear John, Apologies for not providing reproducible example. I just tried with a plm example but ran into the same issue; library(plm) data("Produc", package = "plm") zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, index = c("state","year")) Ef.hd <- Effect(c("pc", "e

Re: [R] Marginal effects with plm

2018-09-06 Thread Fox, John
to answer your question. Best, John > -Original Message- > From: Miluji Sb [mailto:miluj...@gmail.com] > Sent: Thursday, September 6, 2018 5:37 AM > To: Fox, John > Cc: r-help mailing list > Subject: Re: [R] Marginal effects with plm > > Dear John, > >

Re: [R] Marginal effects with plm

2018-09-06 Thread Miluji Sb
Dear John, Thank you very much for the solution and the suggestion. I have tried the following; plm1 <- plm(formula = log(gva_ind) ~ poly(x1, 2, raw=TRUE) + heat*debt_dummy + tt, data = df, index=c("region","year")) Ef.hd <- Effect(c("heat", "debt_dummy"), plm1) But get the following error; -

Re: [R] Marginal effects with plm

2018-09-05 Thread Fox, John
Dear Milu, Depending upon what you mean by "marginal effects," you might try the effects package. For example, for your model, try (Ef.hd <- Effect(c("heat", "debt_dummy"), plm1)) plot(Ef.hd) A couple of comments about the model: I'd prefer to specify the formula as log(y) ~ p