# \donttest{
# Generate data from the GC spatial regression model with lattice spatial dependency
W <- rAdj(500) # Generate a random adjacency matrix
DDl <- rGClat(n = 500, alpha = 1, beta0 = 0.3, beta = c(-0.5, 0.5), W = W, V = 1)
# Prepare the data
Y <- DDl$y
covariate <- DDl$covariate
ID <- DDl$ID
# Fit the spatial GC model
ResultGC <- GClat(Y = Y, ID = ID, covariate = covariate, W = W)
# Summary of the model fit
summary(ResultGC)
# }
Run the code above in your browser using DataLab