1

I tried to get the map of Wisconsin and try to do Clark-Evans test on spatial data points. However, when I import the map of wisconsin and try to convert it into a window, I met the error:

Warning message: 244 points were rejected as lying outside the specified window

I used the following code:

wisc.map <- map("state", "wisconsin", fill=T)
w <- owin(poly=data.frame(x=rev(wisc.map$x), y=rev(wisc.map$y)))

And I got error after I ran spat = as.ppp(data, w)

It is clearly that all my data points are in Wisconsin like the plot showed below: enter image description here

I put some sample data here:

  latitude longitude
1 43.30716 -89.43137
2 43.30388 -89.42823
3 43.31845 -89.44372
4 43.33766 -89.44634
5 43.50815 -89.52010
6 43.34179 -89.01988

Any idea for what's going on?

Thanks


P.S I want to do a Clark Evans Test because I want to check whether there exists clustering pattern among my data. I want to make sure the hotspots obtained from data is statistical significant. I checked many literatures but didn't find the direct way to test it, so I have to use Clark Evans Test... Anyone knows any better tests to check clustering pattern or hotspot significance?

markalex
  • 8,623
  • 2
  • 7
  • 32
Leonard
  • 139
  • 1
  • 11

1 Answers1

1

This is not an error but a warning as the output clearly states. It tells you that 244 of the points you supplied to ppp were outside the polygonal region that you claim to be the observation window. It may be that they are very close to the edge and your polygon approximating Wisconsin just isn't detailed enough.

NOTE: The spatstat package currently doesn't handle spherical geometry, so it is not meaningful to use spatstat functions on latitude and longitude data. Projection used to be done with spTransform from the sp package, but now it may be more convenient to use the more modern simple features package sf which has the function st_transform.

Side note: Why would you want to do a Clark Evans test on this data? It checks that the nearest neighbour distance looks similar for this point pattern and a homogeneous Poisson process with the same expected number of points on the same observation window. So the reference process will distribute approximately the same number of points as your data evenly over all of Wisconsin and your data has points only in the South-Western part of Wisconsin.

Ege Rubak
  • 4,347
  • 1
  • 10
  • 18
  • Thanks, in fact all my data are in the southwest part of Wisconsin. I want to do a Clark Evans Test because I want to check whether there exists clustering pattern among my data. I want to make sure the hotspots obtained from data is statistical significant. I checked many literature but didn't find the direct way to test it, so I have to use Clark Evans Test... Do you know any better tests to deal with it? – Leonard Dec 14 '17 at 15:53
  • The Clark-Evans test assumes you have observed an homogeneous pattern over the entire observation window which is clearly not the case here. You need to know what the actual observation window is before you can proceed with the analysis. – Ege Rubak Dec 15 '17 at 23:38