Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6909623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:42:46+00:00 2026-05-27T08:42:46+00:00

I have a panel data set in R (time and cross section) and would

  • 0

I have a panel data set in R (time and cross section) and would like to compute standard errors that are clustered by two dimensions, because my residuals are correlated both ways. Googling around I found http://thetarzan.wordpress.com/2011/06/11/clustered-standard-errors-in-r/ which provides a function to do this. It seems a bit ad-hoc so I wanted to know if there is a package that has been tested and does this?

I know sandwich does HAC standard errors, but it doesn’t do double clustering (i.e. along two dimensions).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:42:47+00:00Added an answer on May 27, 2026 at 8:42 am

    Frank Harrell’s package rms (which used to be named Design) has a function that I use often when clustering: robcov.

    See this part of ?robcov, for example.

    cluster: a variable indicating groupings. ‘cluster’ may be any type of
          vector (factor, character, integer).  NAs are not allowed.
          Unique values of ‘cluster’ indicate possibly correlated
          groupings of observations. Note the data used in the fit and
          stored in ‘fit$x’ and ‘fit$y’ may have had observations
          containing missing values deleted. It is assumed that if any
          NAs were removed during the original model fitting, an
          ‘naresid’ function exists to restore NAs so that the rows of
          the score matrix coincide with ‘cluster’. If ‘cluster’ is
          omitted, it defaults to the integers 1,2,...,n to obtain the
          "sandwich" robust covariance matrix estimate.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a panel data set: that is, times , ids , and values
I have an unbalanced quarterly panel data set with missing values. I want to
I have and Update Panel with a Grid inside of it. The grid's data
I have panel that is using group layout to organize some label. I want
I have an Panel control that I need to maintain position across postbacks. I
I have a panel that draws alot of things. To make drawing effecient I
I have update panel that content check box, textbox, 3 DropDownList with CascadingDropDown extender.
I have stack panel with custom controls in it. I attach standard MouseDragElementBehavior to
I have a panel that is docked to the right side of a windows
Is it possible to do regressions in R using a panel data set with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.