Marginal effects with plm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Marginal effects with plm

Miluji Sb
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"))

where 'df' is a pdata.frame. I would like to obtain marginal effects of 'y'
for the variable 'x1'. I have tried the packages 'prediction' and 'margins'
without luck.

Is it possible to obtain marginal effects with 'plm'? Any help will be
highly appreciated. Thank you.

Error in UseMethod("predict") :
  no applicable method for 'predict' applied to an object of class
"c('plm', 'panelmodel')"

Sincerely,

Milu

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Marginal effects with plm

Ista Zahn
You might be interested in the "prediction" and "margins" packages.

--Ista

On Wed, Sep 5, 2018 at 6:30 PM Miluji Sb <[hidden email]> 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"))
>
> where 'df' is a pdata.frame. I would like to obtain marginal effects of 'y'
> for the variable 'x1'. I have tried the packages 'prediction' and 'margins'
> without luck.
>
> Is it possible to obtain marginal effects with 'plm'? Any help will be
> highly appreciated. Thank you.
>
> Error in UseMethod("predict") :
>   no applicable method for 'predict' applied to an object of class
> "c('plm', 'panelmodel')"
>
> Sincerely,
>
> Milu
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Marginal effects with plm

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 <[hidden email]> wrote:

> You might be interested in the "prediction" and "margins" packages.
>
> --Ista
>
> On Wed, Sep 5, 2018 at 6:30 PM Miluji Sb <[hidden email]> 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"))
> >
> > where 'df' is a pdata.frame. I would like to obtain marginal effects of
> 'y'
> > for the variable 'x1'. I have tried the packages 'prediction' and
> 'margins'
> > without luck.
> >
> > Is it possible to obtain marginal effects with 'plm'? Any help will be
> > highly appreciated. Thank you.
> >
> > Error in UseMethod("predict") :
> >   no applicable method for 'predict' applied to an object of class
> > "c('plm', 'panelmodel')"
> >
> > Sincerely,
> >
> > Milu
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.