[R] Clustered standard errors in a panel

From: Thomas Davidoff <davidoff_at_haas.berkeley.edu>
Date: Thu 21 Jul 2005 - 10:50:22 EST

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


        [[alternative HTML version deleted]]

R-help@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 Received on Thu Jul 21 10:56:16 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:53 EST