Displaying 20 results from an estimated 3000 matches similar to: "Autocorrelation in linear models"
2011 Jun 08
1
Autocorrelation in R
Hi,
I am trying to learn time series, and I am attending a colleague's
course on Econometrics. However, he uses e-views, and I use R. I am
trying to reproduce his examples in R, but I am having problems
specifying a AR(1) model. Would anyone help me with my code?
Thanks in advance!
Reproducible code follows:
download.file("https://sites.google.com/a/proxima.adm.br/main/ex_32.csv
2004 Jul 21
2
Testing autocorrelation & heteroskedasticity of residuals in ts
Hi,
I'm dealing with time series. I usually 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
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(Y ~ X - 1)
dwtest(fit,alternative="two.sided")
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
2003 Jun 04
1
Error Using dwtest
Hello all-
I have 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
2002 Oct 29
0
updated package "lmtest" 0.9-2
Dear R users,
there is a new version of the package `lmtest' for testing linear
regression models on CRAN. Except for a couple of minor bug fixes,
there are 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,
2008 Nov 06
2
How to return individual equation from {aidsEst} in package [micEcon]?
Hi, R core team
I am using the function {aidsEst} in package [micEcon] to do an AIDS
model now. So far, everything is good. But I want to test the auto
correlation and heteroskedasticity of the individual equation from AIDS
demand system. How can I return the individual equation?
PS: serial correlation test is {bgtest} in package [lmtest] and
heteroskedasticity is {bptest} in package
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
2003 Aug 04
3
Breusch-Godfrey Test
> Dear R Helpers!
>
> bgtest{lmtest} performs the Breusch-Godfrey test for higher
> order serial
> correlation.
>
> Is the Higher Order Correlation function already programmed in
> R I couldn't find it?
>
> Sergei Petrov
>
?acf
?pacf
HTH,
Bernhard
----------------------------------------------------------------------
If you have received this e-mail
2011 Aug 12
1
Which Durbin-Watson is correct? (weights involved) - using durbinWatsonTest and dwtest (packages car and lmtest)
Hello!
I have a data frame mysample (sorry for a long way of creating it
below - but I need it in this form, and it works). I regress Y onto X1
through X11 - first without weights, then with 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
2001 Nov 21
2
dw statistic
Hello Uwe
First, I want to thank you for spending your time replying to my mail. I'm
very impressed with the speed that my question was answered.
I'm new at R (about two weeks) and reading your mail made me realize that it
was indeed a question of vectors of different lengths. I thinked that I
could create a function ("carfun") without creating a "x" vector, since
2003 Aug 13
1
means comparison with seasonal time series?
Dear R list,
I have a sequence of weekly observations of number of adults and larvae
in various size classes from a butterfly population living in a
subtropical area with pronounced wet and dry seasons. Wet and dry
seasons are each defined 26 weeks long with fixed start and end dates.
The data span 103 weeks (two seasons each of wet and dry) with some
missing weeks. What I would like to do is
2010 Dec 26
2
What is the best way to lag a time series?
Dear R-users,
I've been using R for a while and I am very satisfied! Unfortunately, I
still have not figured out an efficient and general way to construct and
use lags of time series, especially when I need to work with different
packages.
Let me give an example. I have two time series x and y and I want to
estimate a variaty of distributed lags models and run different tests
2009 Jun 26
1
Heteroskedasticity and Autocorrelation in SemiPar package
Hi all,
Does anyone know how to report heteroskedasticity and autocorrelation-consistent standard errors when using the "spm" command in SemiPar package? Suppose the original command is
sp1<-spm(y~x1+x2+f(x3), random=~1,group=id)
Any suggestion would be greatly appreciated.
Thanks,
Susan
[[alternative HTML version deleted]]
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
2009 Aug 24
1
lme, lmer, gls, and spatial autocorrelation
Hello folks,
I have some data where spatial autocorrelation seems to be a serious
problem, and I'm unclear on how to deal with it in R. I've tried to do my
homework - read through 'The R Book,' use the online help in R, search the
internet, etc. - and I still have some unanswered questions. I'd greatly
appreciate any help you could offer. The super-super short explanation is
2008 Jul 06
1
Different Autocorrelation using R and other softwares
Dear All,
Would like to ask the inconsistency in the autocorrelation from R with
SPSS/Minitab. I have tried a dataset x with 20 data (1-20) and ask R to give
the autocorrelation of different lags using the command < acf(x,
lag.max=100, type = "correlation"), However while SPSS and Minitab give the
same answers (0.85 for lag1), R gives 0.3688 which is much smaller.
Obviously, the
2009 Oct 06
1
Spatial Autocorrelation
Hello,
I have a matrix with the distances among sites. And I have another matrix
with the presence and absence of each species in each site. I would like to
test the spatial autocorrelation among sites.
I have tried to use the function gearymoran of the ade4 package, but error
messages keep popping up. Do you know any function for me to test the
spatial autocorrelation of my data?
Thanks,
2004 Aug 25
1
Newbie Question: Spatial Autocorrelation with R Tutorial?
Howdy All,
I am looking for some good tutorials (books, websites, whatever) for calculating/testing for Spatial Autocorrelation using R.
Specifically, I am wanting to test for autocorrelation of a number of variables measured at a set of discrete locations.
Up to this point I have been exploring the "spdep" package and I can get "moran.test" to work, but I am concerned that
2010 Apr 29
1
a question on autocorrelation acf
Hi R users,
where can I find the equations used by acf function to calculate
autocorrelation? I think I misunderstand acf. Doesn't acf use following
equation to calculate autocorrelation?
[image: R(\tau) = \frac{\operatorname{E}[(X_t - \mu)(X_{t+\tau} -
\mu)]}{\sigma^2}\, ,]
If it does, then the autocorrelation of a sine function should give a
cosine; however, the following code gives a