[R] R: Package plm & heterogenous slopes
Millo Giovanni
Giovanni_Millo at Generali.com
Mon Feb 8 11:41:10 CET 2010
Dear Otto,
great. Re your follow-up question, it is not directly feasible in 'plm'; although I like the partitioned regression solution you cite, which should work.
As an alternative suggestion, I would check the packages 'nlme' and 'lme4', which allow very flexible specifications. E.g., you can have fixed and random coefficients together with (data from Munnell's model, see ?Produc):
data(Produc, package"Ecdat")
library(nlme)
m0 <- lme(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc, random=~1+pcap|state)
summary(m0)
where you get state random effects and one random coefficient. Although I don't think this is exactly what you want, it might be a promising direction (and sure on this list there are some nlme experts: but sadly, not me).
Best wishes,
Giovanni
-----Messaggio originale-----
Da: Otto Kässi [mailto:otto.kassi at gmail.com]
Inviato: lunedì 8 febbraio 2010 09:32
A: Millo Giovanni
Cc: r-help at r-project.org; yves.croissant at let.ish-lyon.cnrs.fr
Oggetto: Re: [R] Package plm & heterogenous slopes
Giovanni,
Thank you for your reply. pvcm is indeed what I was looking for.
I have a follow-up questio: plm documentation says that pvcm with method 'within' is equivalent of estimating a separate model for each individual. Let's assume that I would like to estimate a panel data model with an individual-specific intercept, individual-specific slope and a regressor that has a common coefficient for all individuals.
I.e. a model of the form: y_it = a_i + b_i*t + c*x_it + e_it. Is this doable in plm?
I came up with two non-plm solutions to my problem. One possible approach would be to estimate a model y ~ id + id*t + c with ols, but this doesn't seem feasible with a dataset of several hundreds of individuals. Another approach would be to apply Frisch-Waugh-Lovell theorem and estimate the regression coefficients in multiple steps.
Using plm, if possible, would feel more straightforward though.
Regards,
Otto
On Thu, Feb 4, 2010 at 4:46 PM, Millo Giovanni <Giovanni_Millo at generali.com> wrote:
> Dear Otto,
>
> please see ?pvcm and the section on variable coefficient models here
> http://www.jstatsoft.org/v27/i02/paper
>
> Should suit your needs; else please let me know.
>
> Best,
> Giovanni
>
> ------------- original message -----------------
>
> Message: 29
> Date: Wed, 3 Feb 2010 16:27:45 +0200
> From: Otto K?ssi <otto.kassi at gmail.com>
> To: r-help at r-project.org
> Subject: [R] Package plm & heterogenous slopes
> Message-ID:
> <bcc3d8561002030627i354db4e8i363d3b1c886f0337 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Dear r-helpers,
>
> I am working with plm package. I am trying to fit a fixed effects (or
> a 'within') model of the form y_it = a_i + b_i*t + e_it, i.e. a model
> with an individual-specific intercept and an individual- specific
> slope.
>
> Does plm support this directly?
>
> Thanks in advance!
> Otto Kassi
>
>
>
> ------------- end original message -------------
>
> Giovanni Millo
> Research Dept.,
> Assicurazioni Generali SpA
> Via Machiavelli 4,
> 34132 Trieste (Italy)
> tel. +39 040 671184
> fax +39 040 671160
>
Ai sensi del D.Lgs. 196/2003 si precisa che le informazi...{{dropped:13}}
More information about the R-help
mailing list