Hi! I have a dataset of properties that are owned by different firms, each firm owning multiple properties. I am running a regression of holding period (how long a property was held in a firm's portfolio) on the left, and a bunch of factors on the right. When calculating standard errors, I would like to cluster my disturbance terms by firm. Any ideas on how to do this? I'm guessing gls() from nlme, but what sorts of options? Toby
GLS could work. There are a host of corClass functions for spatial and serial correlations in this package. Or you could specify firm as a grouping factor and use lmer() found in the Matrix package. -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Tobias Muhlhofer Sent: Tuesday, August 23, 2005 12:37 PM To: r-help at stat.math.ethz.ch Subject: [R] clustering of disturbances Hi! I have a dataset of properties that are owned by different firms, each firm owning multiple properties. I am running a regression of holding period (how long a property was held in a firm's portfolio) on the left, and a bunch of factors on the right. When calculating standard errors, I would like to cluster my disturbance terms by firm. Any ideas on how to do this? I'm guessing gls() from nlme, but what sorts of options? Toby ______________________________________________ R-help at stat.math.ethz.ch mailing list stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! R-project.org/posting-guide.html