search for: dwtest

Displaying 19 results from an estimated 19 matches for "dwtest".

Did you mean: dvtest
2009 Aug 03
1
Comparison of Output from "dwtest" and "durbin.watson"
Should "dwtest" and "durbin.watson" be giving me the same DW statistic and p-value for these two fits? library(lmtest) library(car) X <- c(4.8509E-1,8.2667E-2,6.4010E-2,5.1188E-2,3.4492E-2,2.1660E-2, 3.2242E-3,1.8285E-3) Y <- c(2720,1150,1010,790,482,358,78,35) W <- 1/Y^2 fit <- lm(...
2009 Aug 05
2
Durbin-Watson
Hi, I ran an experiment with 3 factors, 2 levels and 200 replications and as I want to test for residuals independence, I used Durbin-Watson in R. I found two functions (durbin.watson and dwtest) and while both are giving the same rho, the p-values are greatly differ: > durbin.watson(mod1) lag Autocorrelation D-W Statistic p-value 1 -0.04431012 2.088610 0.012 Alternative hypothesis: rho != 0 > dwtest(mod1) Durbin-Watson test data: mod1 DW = 2.0886, p-value...
2011 Aug 12
1
Which Durbin-Watson is correct? (weights involved) - using durbinWatsonTest and dwtest (packages car and lmtest)
...ith weights: regtest1<-lm(Y~., data=mysample[-13])) regtest2<-lm(Y~., data=mysample[-13]),weights=mysample$weight) summary(regtest1) summary(regtest2) Then I calculate Durbin-Watson for both regressions using 2 different packages: library(car) library(lmtest) durbinWatsonTest(regtest1)[2] dwtest(regtest1)$stat durbinWatsonTest(regtest2)[2] dwtest(regtest2)$stat When there are no weights, the Durbin-Watson statistic is the same. But when there are weights, 2 packages give Durbin-Watson different statistics. Anyone knows why? Also, it's interesting that both of them are also different...
2003 Jun 04
1
Error Using dwtest
...ave two time series, Index1stdiff and Comps1stdiff. I regressed the first on the second and R returned the summary stats I expected. Then I looked at and plotted the residuals. I then wanted to assess autocorrelation characteristics and tried to run a Durbin-Watson using: library(lmtest) dwtest(formula=Index1stdiff~Comps1stdiff,alternative=c("greater")) I am getting the following error: Error in solve.default(crossprod(X), tol = tol) : Lapack routine dgesv: system is exactly singular Can anyone assess why my attempt crashes? I tried this earlier on what I thought w...
2002 Apr 19
4
Durbin-Watson test in packages "car" and "lmtest"
Hi, P-values in Durbin-Watson test obtained through the use of functions available in packages "lmtest" and "car" are different. The difference is quite significant. function "dwtest" in "lmtest" is much faster than "burbinwatson" in "car". Actually, you can take a nap while the latter trying to calculated Durbin-Watson test. My question is which p-value is better? Thank you, Ahmad Abu Hammour -------------- next part -------------- An HTML...
2008 Jul 24
0
Problem with GLS dwtest function
Hi, I want to test for independence in my GLS model fitp2, but when I try to use the dwtest function in the lmtest library, I get the error message "Error in terms.default(formula) : no terms component". The model and data set are below. Any suggestions would be really helpful! Thanks a lot in advance, M. Grace fitp2: fitp2<-gls(V3_total~D_total+P_total,data=pdata,weights...
2004 Jul 21
2
Testing autocorrelation & heteroskedasticity of residuals in ts
...ally use stl() to estimate trend, stagionality and residuals. I test for normality of residuals using shapiro.test(), but I can't test for autocorrelation and heteroskedasticity. Is there a way to perform Durbin-Watson test and Breusch-Pagan test (or other simalar tests) for time series? I find dwtest() and bptest() in the package lmtest, but it requieres an lm object, while I've a ts object. Any help will be appreciated. Best Vito ===== Diventare costruttori di soluzioni Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_pal...
2011 Jun 08
1
Autocorrelation in R
...e follows: download.file("https://sites.google.com/a/proxima.adm.br/main/ex_32.csv --no-check-certificate", "ex_32.csv", method="wget") ex32=read.csv("ex_32.csv") lm_ex32=lm(gc ~ yd, data=ex32) summary(lm_ex32) # Durbin-Watson (slide 26) library(lmtest) dwtest(gc ~ yd, data=ex32) # or dwtest(lm_ex32) # Breusch-Godfrey bgtest(lm_ex32, order=2) # AR(1) # In e-views, the specification was: # GC = YD AR(1) # and the output was: # Dependent Variable: GC # Method: Least Squares # Sample: 1970Q2 1995Q2 # Included observations: 101 # Convergence achieved aft...
2011 Mar 16
1
Autocorrelation in linear models
...fore any model is fitted. Would you test for autocorrelation both in the data and in the residuals? If we limit our worries to the residuals, it looks like we have a variety of tests for lag=1: stats::cor.test(residuals(fm)[-n], residuals(fm)[-1]) stats::Box.test(residuals(fm)) lmtest::dwtest(fm, alternative="two.sided") lmtest::bgtest(fm, type="F") In my model, a simple lm(y~x1+x2) with n=20 annual measurements, I have significant _positive_ autocorrelation within Y and within both X vectors, but _negative_ autocorrelation in the residuals. The residual autoc...
2003 Aug 13
1
means comparison with seasonal time series?
...(two seasons each of wet and dry) with some missing weeks. What I would like to do is compare means of each type of observation between wet and dry seasons ("Does the number of adults observed vary by season?"). Not surprisingly there is pronounced autocorrelation in the data, e.g.: dwtest(lm(numadults ~ week)) gives DW = 0.2727, p-value = < 2.2e-16 Note that the effects of this autocorrelation extend across wet-dry and dry-wet boundaries. What would be a way to ask my questions in R? I'm still learning R (and statistics) so detailed answers would be most appreciated....
2005 May 19
1
Calculation of Durbin-Watson p-value
Sir,   I am unable to get the source code for Durbin-Watson test, as I want to calculate the p-value for Durbin Watson statistic using interpolation method. I sent this mail to r-help, but it was rejected, please suggest me some way. I will be highly greatful to you. Thanks in advance Ramesh [[alternative HTML version deleted]]
2001 Nov 21
2
dw statistic
...(=length("(dw-eigen)")) to be integrated? The computation of the exact p-value of DW is a hard one (since it depends on X matrices and the formula is a bit complicated), but the DW statistic is a valuable calculation in econometrics. The package "lmtest" has a function "dwtest", but it doesn't give any p-value. Thank you once more. > > »dwf0 <- function(dw,eigen) { carfun <- function(x) { > > >(prod(1+2*(eigen-dw)*1i*x)^(-1/2)-prod(1-2*(eigen-dw)*1i*x)^(-1/2))/(1i*x) >} > > ; 1/2+integrate(f=carfun,lower = 0,upper = Inf, &gt...
2011 Dec 30
3
Break Points
Respected Sir I tried the strucchange My data is attached. However I tried the attached commands (last save.txt) to perform Bai Perron 2003... I t worked well but in the end it is giving warning that overlapping confidence interval... I am not sure how to proceed... Please Help Me Thanking You Ayanendu Sanyal -- Please have a look at our new mission and contribute into it (cut and paste the
2002 Oct 29
0
updated package "lmtest" 0.9-2
...re essentially these new features: o added Breusch-Godfrey test for serial correlation (thanks to David M. Mitchell who provided the initial version of the code for bgtest) o new data sets: mandible measurements in fetuses, US macroecnomic time series o the Durbin-Watson test dwtest() now takes an alternative argument. The default is to test for positive autocorrelation (which was the only option before). o a vignette, which describes the package. This is a version of an article that will be published in the forthcoming R News 2(3). The DESCRIPTION of the package...
2001 Jun 21
2
Durbin Watson stat for ser. corr
Dear R People: Do any of the linear model or regression function calculate the Durbin-Watson test statistic for serial correlation, please? I found the hat matrix, studentized residuals, and so on, but no D-W. Thanks so much! Sincerely, Erin M. Hodgess, Ph.D. Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown One Main Street Houston, TX 77002
2010 Jul 11
1
Durban Watson statistics
I would like to do the Durban-Watson test on a time series of log returns. 2 questions: 1) If I am just trying to find out if there is serial correlation, what do I do for the residuals? there is no model, so do I just use the log returns (time series) itself? 2) what is the code in R to accomplish this? Regards [[alternative HTML version deleted]]
2013 Nov 25
2
Durbin Watson Test Bound in R
Hi, How could I use R to check Durbin Watson Test Bound? Best, Rebecca
2011 Nov 20
2
I'm writing this letter to enquire where can I download the package of "lmtest".
Dear editor: I'm writing this letter to enquire where can I download the package of "lmtest". Can you send me this package? THanks a lot. Best regards, Shu-Fei Wu
2007 Mar 07
2
where can I find Durbin-Waston test tables for Confidence Level 2.5% or 0.5%?
Hi all, I am doing a two-sided DW test: H0: rho = 0 H1: rho =/= 0 My understanding is that most test statistics tables are one-sided. It's the way they created the table. So from online, by doing Googling, I found a bunch of DW tables for Confidence Level 5%. Those tables can answer my two-sided question at 5x2 = 10% confidence level. But what if I want two-sided test at 1% and 5%