Skip to main content
11 votes

Robust regression inference and Sandwich estimators

One can use an alternative summary function to perform a robust regression. lm.object <- lm(a~b+c) summary(lm.object, robust=TRUE) To obtain robust standard ...
Daniel Kah's user avatar
7 votes
Accepted

How to calculate sandwich standard errors for generalized least squares models?

Generalized least squares jointly models fixed effects and a covariance structure in data to yield Gauss-Markov optimal estimators of the fixed effects. We can also refer to the fixed effects as the "...
AdamO's user avatar
  • 63.5k
7 votes
Accepted

Standard Errors with Weighted Least Squares Regression

Essentially you already computed everything you need. The missing piece is just that the sig_i should be the residual standard error divided by the corresponding ...
Achim Zeileis's user avatar
4 votes

How to estimate robust sandwich standard errors when estimating parameters using optim() in R?

It is in principle possible but potentially burdensome, especially if you have many observations. The reason is the following: For the full sandwich you need the "bread" for which the observed Hessian ...
Achim Zeileis's user avatar
4 votes

Difference between Quasi-Poisson and Sandwich Covariance

From a purely applied perspective, my experience is that the difference between these methods is typically not huge, leading to qualitatively the same conclusions (see Table 2 in the vignette you ...
Achim Zeileis's user avatar
3 votes

Robust Residual standard error (in R)

If you are interested in the conditional mean $\mathop{\mathbb{E}} \bigl[ y_j|X_j \bigr] = X_j' \beta$, where $X_j$ may be in or out of sample, then of course you can get the standard error for that ...
StasK's user avatar
  • 31.9k
3 votes

effect estimate without constant variance (r sandwich vcovHC)

When using the sandwich standard error, the association between $X$ and $Y$ is no different than in the model: the regression slope, or "X" coefficient is the same ...
AdamO's user avatar
  • 63.5k
2 votes

How to estimate robust sandwich standard errors when estimating parameters using optim() in R?

You can use a bootstrap. The sandwich covariance estimator is a first order approximation to the bootstrap, and the overlap of robustness properties is substantial. The only disadvantage to this ...
AdamO's user avatar
  • 63.5k
2 votes
Accepted

Can a subject appear multiple times in a risk set in recurrent event analyses?

The counting process analysis might be better described as an analysis of "times to events" rather than of "time to first event." Therneau and Grambsch describe various approaches ...
EdM's user avatar
  • 94.6k
1 vote

How can I tell if a clutser-randomised crossover trial has made a unit of analysis error?

The 'two-sided' test indeed means they consider deviations of the test statistic in both the negative and positive sense (lower and upper tail). A two-sided $\alpha=0.05$ is very standard, if you were ...
PBulls's user avatar
  • 5,153
1 vote

what does generalized estimating equations with robust standard error mean

Here is an example of how to do this using the lalonde dataset in cobalt, where treat is a ...
Noah's user avatar
  • 34.6k
1 vote

How to compute sandwich estimator with QMLE and Poisson regression in R (using glmrob package)

There may not be a way to do this (i.e., it hasn't been developed statistically yet). You can use a non-robust Poisson QMLE just using glm(., family = quasipoisson) ...
Noah's user avatar
  • 34.6k
1 vote

How to compute the sandwich variance ML estimator in R

I just found the answer to my problem by comparing the manual method versus the QMLE robust standard errors for a GARCH using the package fGarch. The solution is as ...
Julian Pineda's user avatar
1 vote
Accepted

Decision between vcovPC and vcovPL (sandwich)

The answer depends on the type of panel you have. The vcovPL() approach can only work well if the panels are long enough so that the autocorrelation over time can ...
Achim Zeileis's user avatar
1 vote
Accepted

Robust SE clustered GLM Gamma Log Link to match GEE Robust SE

I've tried to follow this post and these directions but neither give me the correct robust SE. I figure you are missing the cadjust argument. You can either create ...
Benjamin Christoffersen's user avatar
1 vote

How to determine if correlated errors are a result of using an incorrect functional form?

First of all applying linear regression may be flawed due to needed lag structures in the causals and very possibly anomalies in any series. The suggested approach is to form a Transfer Function (...
IrishStat's user avatar
  • 30k
1 vote
Accepted

Variance Estimation for Least Squares with Probability Weights

You can use the survey package, but if you want more flexibility in how the standard errors are computed, you need to use the ...
Noah's user avatar
  • 34.6k
1 vote
Accepted

Wondering what type of covariance correction for standard errors is better: Hansen-Hodrick or Newey-West?

statsmodels uses by default Newey-West corrected standard errors with the usual Bartlett window. There is a 'weights_func' or 'kernel' option to choose a different window than Bartlett, eg. uniform. ...
Josef's user avatar
  • 3,292
1 vote

How to implement the sandwich estimator in a semi-parametric situation?

The sandwich estimator does not pertain only to maximum likelihood. It is often used with maximum likelihood and if you estimate a correctly specified model then you obtain the information matrix as ...
Nick's user avatar
  • 359
1 vote
Accepted

Reference for incremental sandwich covariance from biglm?

There isn't a reference, because it's too minor to be publishable. I've put the computations here. It's just algebra: multiplying out the middle term of the sandwich estimator and collecting terms so ...
Thomas Lumley's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible