stscl / gdverse

Analysis of Spatial Stratified Heterogeneity
https://stscl.github.io/gdverse/
25 stars 4 forks source link

help #3

Closed overxp closed 2 months ago

overxp commented 2 months ago

Error in checkForRemoteErrors(val) : 7 nodes produced errors; first error: 非整合陈列

我的数据是西安市的一部分市区数据 image

image

overxp commented 2 months ago

W_cont_el <- spdep::poly2nb(data, queen=T)#queen为T,单个顶点也算相邻 W_cont_el_mat <- spdep::nb2listw(W_cont_el, style="W", zero.policy=TRUE)#zero.policy允不允许无邻居的出现 depression_spade = spade(y1 ~ x1+x4 + x8 + x10, data = data, wt = W_cont_el_mat, cores = 12) 换为基本的mat的报错是 Error in checkForRemoteErrors(val) : 12 nodes produced errors; first error: 量度数目不正确

SpatLyu commented 2 months ago

Three suggestions:

  1. Ensure a sufficient sample size, preferably 150 or more. When the sample size is too small, discussing spatial stratified heterogeneity becomes meaningless, and using geographical detector models would also be unnecessary.
  2. When data is limited, there is no need to use multi-core parallel computing, as it may actually slow down the process in such cases.
  3. The wt in spade and idsa needs to be of the matrix type in R. I recommend using the sdsfun package I developed to generate spatial weight matrices for sf objects.

Best regards!

overxp commented 2 months ago

Thanks!But here is a new qustion.I have fix my code as you said, but it still does't work. wt3 = sdsfun::inverse_distance_swm(final_data) depression_spade = spade(y1 ~. , discvar = names(select(final_data,-c(y1))), data = final_data, wt = wt3, cores = 1) image

There seems to be something wrong with my data. Maybe there shouldn't be any gaps in my data image

SpatLyu commented 2 months ago

You can send the data to my email address, lyu.geosocial@gmail.com, and I will help you check the issue.