Description Usage Arguments Value References See Also Examples
View source: R/LMScanSGWH_SAR.R
Get the LM Scan Test for SGWH
1 | LMScanSGWH_SAR(y = y, X = XX, W = W, mC = mC, it2 = it2, NNN = NNN)
|
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). |
The value of the test and Most Likelihood Cluster.
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.