[R] Clustered standard errors in a panel
Spencer Graves
spencer.graves at pdf.com
Thu Jul 21 08:28:13 CEST 2005
Have you considered "lmer" in library(lme4)? If you are interested
in this, you may want to check the article by Doug Bates in the latest R
news, www.r-project.org -> Documentation: Newsletter.
spencer graves
Thomas Davidoff wrote:
> I want to do the following:
>
> glm(y ~ x1 + x2 +...)
> within a panel. Hence y, x1, and x2 all vary at the individual
> level. However, there is likely correlation of these variables
> within an individual, so standard errors need adjustment.
> I do not want to estimate fixed effects, but do want to cluster
> standard errors at the individual level.
> Is there an automated way to do this? Nothing in the cluster
> documentation makes it clear that there is.
>
> (An alternative is to do this by hand. In that case, I would need to
> be able to calculate weighted sums of x1 and x2... at the individual
> level. I can do this at the variable level [with lapply,split and
> unsplit], but would love to be able to do so over the matrix of x's.
> Of course, doing by hand is less easy than an automated solution if
> it exists.)
>
>
> Thomas Davidoff
> Assistant Professor
> Haas School of Business
> UC Berkeley
> Berkeley, CA 94720
> phone: (510) 643-1425
> fax: (510) 643-7357
> davidoff at haas.berkeley.edu
> http://faculty.haas.berkeley.edu/davidoff
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA
spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel: 408-938-4420
Fax: 408-280-7915
More information about the R-help
mailing list