[R-sig-Geo] Question about LM test for residual autocorrelation in R
Hodgess, Erin
HodgessE at uhd.edu
Tue Jul 9 23:07:11 CEST 2013
Hi Dongwoo:
I tried the following example:
> erin1 <- summary(COL.mix.eig, correlation=TRUE, Nagelkerke=TRUE)
> names(erin1)
[1] "type" "rho" "coefficients" "rest.se"
[5] "LL" "s2" "SSE" "parameters"
[9] "logLik_lm.model" "AIC_lm.model" "method" "call"
[13] "residuals" "opt" "tarX" "tary"
[17] "y" "X" "fitted.values" "se.fit"
[21] "similar" "ase" "rho.se" "LMtest"
[25] "resvar" "zero.policy" "aliased" "listw_style"
[29] "interval" "fdHess" "optimHess" "insert"
[33] "trs" "LLNullLlm" "timings" "f_calls"
[37] "hf_calls" "intern_classic" "coeftitle" "Coef"
[41] "NK" "Wald1" "correlation" "correltext"
[45] "LR1"
> erin1$LMtest
[,1]
[1,] 0.2891926
>
and it does indeed have the LMtest result.
Or were you looking for the formula, please?
Thanks,
Erin
________________________________________
From: r-sig-geo-bounces at r-project.org [r-sig-geo-bounces at r-project.org] on behalf of Dongwoo Kang [dwkang1982 at gmail.com]
Sent: Tuesday, July 09, 2013 3:47 PM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] Question about LM test for residual autocorrelation in R
Dear list,
Hello, I am Dongwoo Kang. I am studying Spatial Econometric modeling.
I've faced one question while using *spdep* package in R.
I want to ask your help for my qeustion.
While estimating my empirical models,
I want to test whether residuals of my spatial regression models (SEM, SAR,
SARAR, SDM estimated by maximum likelihood) still have spatial
autocorrelation pattern.
I think I have two options,
1) Moran's I test using *"moran.mc"* function in R,
2) Lagrange multiplier diagnostics with LMerr option using
*"lm.LMtests"* function
in R.
But I also find that for SAR, SDM, *"summary.sarlm"* function returns "LM
test for residual autocorrelation" by default.
However, this LM test is not given for SER and SARAR.
At first, I thought that "Lagrange multiplier diagnostics" and "LM test for
residual autocorrelation" in "*summary.sarlm*" function are same tests.
But in my empirical results, they give me different statistics (please see
below example).
-----< example
>---------------------------------------------------------------------------
> summary.sarlm(sar2, Nagelkerke=T)
...
Log likelihood: -3533.378 for lag model
ML residual variance (sigma squared): 224.88, (sigma: 14.996)
Nagelkerke pseudo-R-squared: 0.76166
Number of observations: 853
Number of parameters estimated: 29
AIC: 7124.8, (AIC for lm: 7393.3)
LM test for residual autocorrelation
test value: 6.8391, p-value: 0.0089184
>
> lm.LMtests(sar2$residuals, listw=w100.listw, test=c("LMerr"))
Lagrange multiplier diagnostics for spatial dependence
data:
residuals: sar2$residuals
weights: w100.listw
LMErr = 3.7108, df = 1, p-value = 0.05406
-------------------------------------------------------------------------------------------------------
I try to find formulation of "LM test for residual autocorrelation" given
by *"summary.sarlm"* function but I couldn't.
Would you tell me where I can get some documents or explanations about "LM
test for residual autocorrelation" given by *"summary.sarlm"*?
I also want to know why "LM test for residual autocorrelation" is not
provided in SER and SARAR models.
Thank you very much for your time.
Best regards,
Dongwoo Kang
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list