search for: vcovhc

Displaying 20 results from an estimated 41 matches for "vcovhc".

2013 Mar 30
1
vcovHC and arima() output
Dear all, how can I use vcovHC() to get robust/corrected standard errors from an arima() output? I ran an arima model with AR(1) and got the estimate, se, zvalue and p-value using coeftest(arima.output). However, I cannot use vcovHC(arima.output) to get corrected standard errors. It seems vcovHC works only with lm and p...
2008 May 08
2
poisson regression with robust error variance ('eyestudy
...ry(foreign) dat <- read.dta("eyestudy.dta") ### Ach, stata codes factor contrasts backwards dat$carrot0 <- ifelse(dat$carrot==0,1,0) dat$gender1 <- ifelse(dat$gender==1,1,0) glm1 <- glm(lenses~carrot0, data=dat, family=poisson(link=log)) summary(glm1) library(sandwich) vcovHC(glm1) sqrt(diag(vcovHC(glm1))) sqrt(diag(vcovHC(glm1, type="HC0"))) ### Result: # > summary(glm1) # Call: # glm(formula = lenses ~ carrot0, family = poisson(link = log), # data = dat) # Deviance Residuals: # Min 1Q Median 3Q Max # -1.1429 -0.9075 0.39...
2009 Apr 22
0
error when using vcovHC()
Dear R users, I meet with an unsolved error when using the function vcovHC() in package sandwich(). I have a balanced panel dataset, and I run the following codes: > library(plm) > data<-plm.data(data, c("state","year")) > fn<-plm(y~x1+x2, data=data, method="within", effect="individual") > library(lmtest) > co...
2012 Mar 12
2
Replicating Stata's xtreg clustered SEs in R
...sis (countries over years) with SEs clustered by country. ?The original analysis was done in Stata 10 with: xtreg [DV] [IVs] fe cluster(country). Using plm() in R (cran.r-project.org/web/packages/plm/index.html), I've replicated the coefficients. I sought to estimate country-clustered SEs with vcovHC(), and tried a variety of options, but couldn't exactly replicate the published (i.e., Stata 10's) SEs. In R, vcovHC(x, method="arellano", type="HC1", cluster="group") came closest to Stata's SEs (differing at the 3rd decimal place or so). Does anyone happ...
2010 May 10
2
Robust SE & Heteroskedasticity-consistent estimation
Hi, I'm using maxlik with functions specified (L, his gradient & hessian). Now I would like determine some robust standard errors of my estimators. So I 'm try to use vcovHC, or hccm or robcov for example but in use one of them with my result of maxlik, I've a the following error message : Erreur dans terms.default(object) : no terms component Is there some attributes to give to maxlik objet for "fitting" the call of vcovHC? Thank you...
2011 Jan 20
2
Regression Testing
...udentized Breusch-Pagan test data: lmfit BP = 11.6768, df = 1, p-value = 0.0006329 From the above, if I'm interpreting this correctly, there is Heteroskedasticity present. To correct for this, I need to calculate robust error terms. From my reading on this list, it seems like I need to vcovHC. > vcovHC(lmfit) (Intercept) df$x (Intercept) 1.057460e-03 -4.961118e-05 df$x -4.961118e-05 2.378465e-06 I'm having a little bit of a hard time following the help pages. So is the first column the intercepts and the second column new standard errors? Than...
2011 Jan 06
2
memisc-Tables with robost standard errors
Hello, I've got a question concerning the usage of robust standard errors in regression using lm() and exporting the summaries to LaTeX using the memisc-packages function mtable(): Is there any possibility to use robust errors which are obtained by vcovHC() when generating the LateX-output by mtable()? I tried to manipulate the lm-object by appending the "new" covariance matrix but mtable seems to generate the summary itself since it is not possible to call mtable(summary(lm1)). I'd like to obtain a table with the following structu...
2007 Feb 19
1
Urgent: How to obtain the Consistent Standard Errors after apply 2SLS through tsls() from sem or systemfit("2SLS") without this error message !!!!!!!!!!!!!
...Reg2SLS <- systemfit("2SLS", system, labels, Inst, saveMemory=TRUE) summary (Reg2SLS) If I try to obtain the HCSE with robcov I obtain the following error message in both cases: Error in rep.default(1, p) : rep() incorrect type for second argument If I tried to apply vcovHAC or vcovHC in the systemfit output of 2SLS I receive the following messages of errors respectively: Error in estfun(x) : no applicable method for "estfun" (for vcovHAC) Error in terms.default(object) : no terms component (for vcovHC) If somebody can help me to solve this problem I will than...
2008 Dec 19
1
svyglm and sandwich estimator of variance
...cept) -0.91893 0.04696 -19.570 < 2e-16 *** x1 0.19710 0.06568 3.001 0.00603 ** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 (Dispersion parameter for poisson family taken to be 0.5722583) Number of Fisher Scoring iterations: 5 library(sandwich) vcovHC(banco.glm7) (Intercept) x1 (Intercept) 4.806945e-13 -4.771409e-13 x1 -4.771409e-13 7.127168e-13 sqrt(diag(vcovHC(banco.glm7, type="HC0"))) (Intercept) x1 6.923295e-07 8.426314e-07 # I think this res...
2011 Sep 19
1
"could not find function" after import
...am trying to build a package (GWASTools, submitted to Bioconductor) that uses the "sandwich" package. I have references to "sandwich" in DESCRIPTION: Imports: methods, DBI, RSQLite, sandwich, survival, DNAcopy and NAMESPACE: import(sandwich) In the code itself is a call to vcovHC: Vhat <- vcovHC(mod, type="HC0") I have sandwich version 2.2-7 installed. When I run R CMD check on my package, I get the following error during checking of examples: * using R Under development (unstable) (2011-08-29 r56828) * using platform: x86_64-apple-darwin9.8.0 (64-bit) ... *...
2011 Jul 11
1
Robust vce for heckman estimators
When using function heckit() from package ‘sampleSelection’, is there anyway to make t-tests for the coefficients using robust covariance matrix estimator? By “robust” I mean something like if a had an object ‘lm’ called “reg” and then used: > coeftest(reg, vcov = vcovHC(reg)). I’m asking this because in Stata we could use function heckman and then use vce option “robust”. We could do the same for cluster. In a more general way, is there anyway to use another covariance matrix to make t-test (e.g. linear hypothesis) for heckit (selection) models? Thanks, Mateus...
2010 Oct 13
1
robust standard errors for panel data
...ate a panel model (small N large T, fixed effects), but would need "robust" standard errors for that. In particular, I am worried about potential serial correlation for a given individual (not so much about correlation in the cross section). >From the documentation, it looks as if the vcovHC that comes with plm does not seem to do autocorrelation, and the NeweyWest in the sandwich package says that it expects a fitted model of type "lm" or "glm" (it says nothing about "plm"). How can I estimate the model and get robust standard errors? Thanks for your he...
2012 Jul 09
1
linearHypothesis and factors
...tinuous variable and year is a factor with various year levels. Individually, each year factor variable is not significant, but I have a suspicion they are jointly significant. I can't figure out how to run a linearHypothesis test with a factor, i.e. linearHypothesis(reg, ??? year=0 ??? , vcov=vcovHC(reg, , "HC1")) Would be very much appreciated. Many thanks, Alex -- View this message in context: http://r.789695.n4.nabble.com/linearHypothesis-and-factors-tp4635814.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
2007 Feb 20
0
Problems with obtaining t-tests of regression coefficients applying consistent standard errors after run 2SLS estimation. Clearer !!!!!
...covHV() from packages lmtest and sandwich. The program lines are the following: *Program lines 2:* *>#### First option: using robcov() ####* *>library (Design)* *>options(scipen=20)* *>robcov(Reg1) ### I tried with Reg 2 too* ** ** ** ***>####Second option: using coeftest and vcovHC ####* *>library (lmtest)* *>library (sandwich)* *>coeftest (Reg1, vcov=vcovHC(Reg1 or Reg2, type="HC0")) ### I tried with Reg 2 too* In the two cases after trying to apply robcov or coeftest I obtained a message of error: *With robcov:* *> Error in rep.default(1, p)...
2008 Apr 10
4
Huber-white cluster s.e. after optim?
I've used optim to analyze some data I have with good results, but need to correct the var-cov matrix for possible effects of clustering of observations (respondents) in small groups (non-independence). Is there any function to adjust the matrix? I heard some time ago that the vcovHC function would have a cluster capability added to it, but I don't see that in my fairly recent version. Cheers, Peter
2005 Jun 02
1
glm with variance = mu+theta*mu^2?
How might you fit a generalized linear model (glm) with variance = mu+theta*mu^2 (where mu = mean of the exponential family random variable and theta is a parameter to be estimated)? This appears in Table 2.7 of Fahrmeir and Tutz (2001) Multivariate Statisticial Modeling Based on Generalized Linear Models, 2nd ed. (Springer, p. 60), where they compare "log-linear model fits to
2010 Oct 14
1
robust standard errors for panel data - corrigendum
...-----Messaggio originale----- Da: Millo Giovanni Inviato: mercoled? 13 ottobre 2010 14:16 A: 'Achim Zeileis'; Max Brown Cc: r-help at stat.math.ethz.ch; yves.croissant at univ-reunion.fr Oggetto: R: [R] robust standard errors for panel data Hello. In principle Achim is right, by default vcovHC.plm does things the "Arellano" way, clustering by group and therefore giving SEs which are robust to general heteroskedasticity and serial correlation. The problem with your data, though, is that this estimator is N-consistent, so it is inappropriate for your setting. The other way round,...
2010 Mar 02
0
Version 1.4.7 of package vars
...estimators, to do inference on the parameters taking into account heteroskedasticity of unknown form. -Implementation of a heteroskedasticity robust Granger causality test with HC covariance and/or a wild bootstrap Example: library(vars) data(Canada) va<-VAR(Canada, p=2) coeftest(va, vcov.=vcovHC) causality(va, vcov.=vcovHC, boot=TRUE) Best Matthieu Stigler _______________________________________________ R-packages mailing list R-packages at r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages
2010 Mar 02
0
Version 1.4.7 of package vars
...estimators, to do inference on the parameters taking into account heteroskedasticity of unknown form. -Implementation of a heteroskedasticity robust Granger causality test with HC covariance and/or a wild bootstrap Example: library(vars) data(Canada) va<-VAR(Canada, p=2) coeftest(va, vcov.=vcovHC) causality(va, vcov.=vcovHC, boot=TRUE) Best Matthieu Stigler _______________________________________________ R-packages mailing list R-packages at r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages
2013 Apr 05
1
white heteroskedasticity standard errors NLS
Hello Is there any function to calculate White's standard errors in R in an NLS regression. The sandwich and car package do it but they need an lm object to calculate the error's. Does anyone have idea how to do it for an NLS object ? Regards The woods are lovely, dark and deep But I have promises to keep And miles before I go to sleep And miles before I go to sleep ----- [[alternative