

Hello everybody,

I am trying to test my model (lm) in a spatial regression model. I have already done the moran I test and found, that due to the spatial correlation it would be wise to try a spatial regression model. When I try to do the eigenwert-matrix or the spatial lag model, i get the following error:


#-------------------------------------------------------------
Fehler in matrix(0, nrow = n, ncol = n) : zu viele Elemente angegeben
#-------------------------------------------------------------
-> English: to many elements specified 


I have a dataset of about 70'000 points. Is it possible that this is too much for the eigenwert-matrix? I use library (spdep)

Here's my code:

#-------------------------------------------------------------
# Get coordinates
d.angeb.efh.sub2$residuals <- reg.lm.bereinigt2$residuals

crds 		<- as.matrix(d.angeb.efh.sub2[, c("LON1903","LAT1903")])

t.neig 		<- knn2nb(knearneigh(crds, k=4, longlat=FALSE))


# Weights-Matrix (W = row-standardized)
n.listw.obj 	<- nb2listw(t.neig, style="W")

# Moran's I Test
moran.test(reg.lm.bereinigt2$residuals, listw=n.listw.obj, alternative="two.sided", na.action=na.exclude,
			zero.policy=TRUE)

# Spatial Lag Model
mod.lag.eig 			<- lagsarlm(log(VPREIS) 									~ 	
							as.factor(ALTER.CL2)								+
 							as.factor(ZIMMERK)								+
 							log(FLAE)										+
 							log(FLAE):as.factor(ZIMMERK)	,
 							data=d.angeb.efh.sub2,
 							n.listw.obj, method="eigen",
 							quiet=FALSE)

# Fehler in matrix(0, nrow = n, ncol = n) : zu viele Elemente angegeben
#-------------------------------------------------------------



Does anyone have a tip how to handle bigger datasets or am I missing something and focusing on the wrong problem?

Thanks for the help,
Jacqueline

Disclaimer\ \ Die in dieser E-Mail enthaltenen Informati...{{dropped:27}}

