search for: neweywest

Displaying 16 results from an estimated 16 matches for "neweywest".

2011 Sep 09
1
Exception in NeweyWest - Pre-Whitening necessary?
Hi guyz, I have run my algorithm in R (see http://pastebin.com/q84Tujfg) and got the following error: Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action, : 'order.max' must be < 'n.used' I am pretty sure, that the error comes from the NeweyWest function in line 45, as the NeweyWest function uses the ar.ols() function for pre whitening. Does anyone has an idea how to circumvent this? Can I just shut off pre whitening? I am thankful for every suggestion. Simon [[alternative HTML version deleted]]
2011 Jul 25
1
biglm() and NeweyWest()
Dear all, I am working on a large dataset and need to use biglm() to perform OLS regressions. I have detected significant ARCH effects which I try to account for using the Newey-West correction. So far, I have worked with NeweyWest() in the sandwich package. NeweyWest() however seems to be unable to handle an object of class "biglm". Looking into the code, I figured out that NeweyWest() calls i) bwNeweyWest() and ii) vcovHAC(), and that both of these functions use estfun(x)... which is unable to handle the object....
2011 Sep 28
1
Robust covariance matrix with NeweyWest()
Dear R-users, I would like to compute a robust covariance matrix of two series of realizations of random variables: ###Begin Example### data <- cbind(rnorm(100), rnorm(100)) model <- lm(data ~ 1) vcov(model) library(sandwich) NeweyWest(model) #produces an error ###End Example### NeweyWest() produces an error but sandwich(), vcovHAC(), kernHAC, weave(),... do not produce any errors. It seems that the model object does not fit in that special case. Nevertheless, the problem is that I need the robust version of the covariance m...
2010 Jun 27
1
NeweyWest
I want to calculate Newey West robust standard error using NeweyWest. Comparing the results to what I get in STATA, in order to get the same results in I need to specify "prewhite=0". Can someone explain what this prewhite command means? Thanks [[alternative HTML version deleted]]
2011 Aug 27
3
Exception while using NeweyWest function with doMC
...n %do% (for sequential run) I have no problems at all - only here and there some singularities in regressor matrices which should be ok. BUT if I run the loop on multiple cores I get very often a bad exception. I have posted the exception on http://pastebin.com/eMWF4cu0 The exception comes from the NeweyWest function loaded within the sandwich library. I have no clue, what it want to say me and why it is so weirdly printed to the terminal. I am used to receive here and there errors....but the messages never look like this. Does anyone have a useful answer for me, where to look for the cause of this w...
2009 Dec 10
2
Problem with coeftest using Newey West estimator
Hi, I want to calculate the t- and p-values for a linear model using the Newey West estimator. I tried this Code and it usually worked just fine: > oberlm <- lm(DYH ~ BIP + Infl + EOil, data=HU_H) > coeftest(oberlm, NeweyWest(oberlm, lag=2)) t test of coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.1509950 0.0743832 2.0300 0.179486 BIP -5.5131683 1.2536813 -4.3976 0.048016 * Infl -0.0623530 0.0036215 -17.2175 0.003356 ** EOil 8.6762170 0.0853...
2010 Sep 23
1
Newey West and Singular Matrix + library(sandwich)
...n page has a few comments. The function > defintions are all one-liners, though. > >> help is, as always, appreciated. ?(also, if you see something else >> silly in my code, let me know, please.) > > 1. There is no assert() function in base R. > 2. The error message of se.neweywest() refers to se.white. > 3. A much more flexible and powerful solution of this is included > ? in package "sandwich", see the vignette for details. The code > ? ? sqrt(diag(NeweyWest(lm_object, lag = 0, prewhite = 0))) > ? replicates se.neweywest(lm_object) but has the followin...
2010 Sep 22
1
Newey West and Singular Matrix
...into lm, then into lm.fit, and it seems to invoke dqrls . is this the recommended way, or is there a higher-level more stable matrix inversion routine that I could use? help is, as always, appreciated. (also, if you see something else silly in my code, let me know, please.) regards, /iaw se.neweywest <- function( lmobject.withxtrue, ar.terms =0 ) { assert( (class(lmobject.withxtrue)=="lm"), "[se.white] works only on 'lm' objects, not on ", class(lmobject.withxtrue), "objects \n" ) x.na.omitted <- lmobject.withxtrue$x assert( class(x.na....
2006 Aug 31
0
Moving Window regressions with corrections for Heteroscedasticity and Autocorrelations(HAC)
...a #extension of Ajay Shah?s code for moving windows simple OLS regression. # The easiest way to adjust for Autocorrelations and Heteroscedasticity in the OLS residuals is to #use the coeftest function that is included in the ?lmtest? packages. # The ?lmtest? package includes the coeftest (model, NeweyWest) command which returns # the ?HAC? consistent estimators along with its standard error, t-stat and pvalue. # To implement the corrections for Heteroscedasticity and Autocorrelations for a moving/rolling # window OLS regression, here is the actual function: #-------------------------------------...
2010 Oct 13
1
robust standard errors for panel data
...;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 help. Max
2010 May 02
1
question about 2SLS
Hi All, I am using R 2.11.0 on a Ubuntu machine. I estimated a model using "tsls" from the package "sem". Is there a way to get Newey West standard errors for the parameter estimates? When estimating the model by OLS, I used "NeweyWest" from the package "sandwich" to get HAC standard errors. But, I am not able to use the same method with the results of the "tsls" estimation. Any help would be appreciated. Deepankar [[alternative HTML version deleted]]
2009 Mar 10
1
HAC corrected standard errors
...up this post: http://www.nabble.com/Re%3A-Moving-Window-regressions-with-corrections-for-Heteroscedasticity-and-Autocorrelations(HAC)-td6075371.html#a6075371 which recommended that I use the coeftest() function in package lmtest, but when I tried to assign an object: result <- coeftest(regre, NeweyWest), where regre is an object of class lm, this returned an error. I'd be grateful for any advice, since I'm sure I'm making one of those simple bloopers. Thanks! Shruthi -- View this message in context: http://www.nabble.com/HAC-corrected-standard-errors-tp22430163p22430163.html Sent...
2008 May 22
1
How to account for autoregressive terms?
...T5")]) d&lt;-ts.union(dep,indep.ret1,indep.ret2,indep.ret3,indep.ret4,indep.ret5,dep.lag1=lag(dep,-1),dep.lag2=lag(dep,-2),dep.lag3=lag(dep,-3)) fit1 &lt;- lm(dep~indep.ret1+indep.ret2+indep.ret3+indep.ret4+indep.ret5+dep.lag1+dep.lag2+dep.lag3,data=d) summary(fit1) #coeftest(fit1,vcov=NeweyWest) 2) using armaFit: fit2&lt;-armaFit(dep~ar(3),xreg=ts(data.df[selection,c("RET1","RET2","RET3","RET4","RET5")]),data=ts(data.df[selection,-1])) summary(fit2) The results of 1) and 2) are completely different. Does anybody have an explanation f...
2010 Oct 14
1
robust standard errors for panel data - corrigendum
...39; ('"time"') to account for serial (cross-sectional) correlation. Thus, the default appears to be to account for serial correlation anyway. But I'm not an expert in panel-versions of these robust covariances. Yves and Giovanni might be able to say more. > and the NeweyWest in the sandwich > package says that it expects a fitted model of type "lm" or "glm" (it > says nothing about "plm"). That information in the "sandwich" package is outdated - prompted by your email I've just fixed the manual page in the development...
2008 Nov 20
0
A Problem while Calculating Newey-West HAC
Hi, Does anyone read Verbeek's "A Guide to Modern Econometrics"? In its Section 4.11, how does the last two equations' HAC calculate? I've tried several groups of parameters in sandwich::NeweyWest, but I still cannot get the same result. I've tried lag=2 and lag=3, as long as prewhite=FALSE and prewhite=TRUE yet, but... Sincerely Hsiao-nan Cheung
2010 Oct 15
0
nomianl response model
...9; ('"time"') to account for serial (cross-sectional) correlation. Thus, the default appears to be to account for serial correlation anyway. But I'm not an expert in panel-versions of these robust covariances. Yves and Giovanni might be able to say more. > and the NeweyWest in the sandwich > package says that it expects a fitted model of type "lm" or "glm" (it > says nothing about "plm"). That information in the "sandwich" package is outdated - prompted by your email I've just fixed the manual page in the development...