LMScanSGWH_SAR: LM Scan test of SGWH in SAR Models

Description Usage Arguments Value References See Also Examples

View source: R/LMScanSGWH_SAR.R

Description

Get the LM Scan Test for SGWH

Usage

1
LMScanSGWH_SAR(y = y, X = XX, W = W, mC = mC, it2 = it2, NNN = NNN)

Arguments

y

: Data vector Rx1

X

: Data vector Rxk include the constant

W

: W matrix RxR

mC

: minimúm cluster size.

it2

: The number of Monte Carlo replications, e.g., 999, 9999

NNN

: Set of windows (circular or elliptic).

Value

The value of the test and Most Likelihood Cluster.

References

Chasco C., Le Gallo, J and López F.A. A Scan test for spatial groupwise heteroscedasticity in cross-sectional models with an application on houses prices in Madrid

See Also

nn_ellipse

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
R=100
y<-runif(R,0,1)
XX<-as.matrix(cbind(matrix(1,R,1),runif(R,0,1)))
cx <- runif(R, 0, 1)
cy <- runif(R, 0, 1)
co <- cbind(cx,cy)
W <- spdep::nb2mat(spdep::knn2nb(spdep::knearneigh(co,k=5,longlat=F)))
mC <- 10
NN <- ScanSGWH::nn_ellipse(Cx=co[,1],Cy=co[,2],nn=50,p=30)
## Circles
NNN<-NN$circles
it2 <- 999
LMScan <- LMScanSGWH_SAR(y=y,X=XX,W=W,mC=mC,it2=it2,NNN=NNN)
## Ellipses
NNN<-NN$ellipses
it2 <- 100
LMScan <- LMScanSGWH_SAR(y=y,X=XX,W=W,mC=mC,it2=it2,NNN=NNN)

f8l5h9/ScanSGWH documentation built on Feb. 3, 2022, 12:30 a.m.