Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aem.time send a warning and an error when printing results #27

Open
guiblanchet opened this issue Dec 18, 2023 · 2 comments
Open

aem.time send a warning and an error when printing results #27

guiblanchet opened this issue Dec 18, 2023 · 2 comments

Comments

@guiblanchet
Copy link
Collaborator

This is a slightly tricky problem because, if I run the first line of the example code of the aem.time function :

out <- aem.time(20, moran = TRUE)

There is the following warning :

Warning messages:
1: In mat2listw(mat01) :
style is M (missing); style should be set to a valid value
2: In mat2listw(mat01) :
no-neighbour observations found, set zero.policy to TRUE;
this warning will soon become an error

But there are no error. However, when calling the object out, there is the following error message :

Error in print.listw(x) :
regions with no neighbours found, use zero.policy=TRUE

After a bit of digging and some clarification from r-spatial/spdep#136, found that the warnings and error can be solved by changing L134 of the aem.time function from

lw <- mat2listw(mat01)

to

lw <- mat2listw(mat01, style = "W", zero.policy = TRUE)

@sdray
Copy link
Collaborator

sdray commented Dec 19, 2023

Hi Guillaume,
I will correct but are you sure that you need row standardization (i.e., style = "W") ? If you want to keep weights untransformed, style should be "B"

Cheers

@guiblanchet
Copy link
Collaborator Author

guiblanchet commented Dec 19, 2023

You are right ! Using style="B" would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants