[R-sig-Geo] Loosmore and Ford (2006) Goodness-of-fit (GoF) test for CSR
Aurelie C.Godin
godina at dal.ca
Thu Mar 1 16:39:23 CET 2012
Dear all,
I am trying to use Loosmore and Ford (2006) GoF test for CSR. I was
wondering if anyone here is familiar with this test and could help me coding
it with my data. Or perhaps suggest something else.
The authors provided an R source code and user's guide for the
implementation of their statistical test described in their paper. Available
at: http://www.esapubs.org/archive/ecol/E087/120/suppl-1.htm#anchorAuthors
http://www.esapubs.org/archive/ecol/E087/120/suppl-1.htm#anchorAuthors
There are multiple steps and I am not quiet sure if I need to run them all
or not... but regardless, I get an error message at step 1 (see below)!
"GR" is my point pattern (with my marks of specific interest) and it is a
subset of "OT". Basically, I want to test the Ho : that my marks (GR) are
distributed randomly within the non-random spatial distribution of my event
(OT).
http://r-sig-geo.2731867.n2.nabble.com/file/n7332928/OTGR.RData OTGR.RData
> OT
planar point pattern: 2691 points
window: polygonal boundary
enclosing rectangle: [-80, -57.6343] x [66.25, 78.16666] units
> GR
planar point pattern: 563 points
window: polygonal boundary
enclosing rectangle: [-80, -57.6343] x [66.25, 78.16666] units
Loosmore & Ford GoF
source("http://www.esapubs.org/archive/ecol/E087/120/cedl_scr.r")
library(spatstat)
# STEP 1 in Loosmore & Ford R code
# gen.ext.pp.list() generates an external CSR point pattern list.
#Note, this function overwrites any externally named variables `my.pp.list'
and `pp.indx' if they already exist.
# input variables:
# - nsim.pp is the number of simulated point patterns in this list
# - npts is the number of points in each pattern
# - type is the pattern type to be generated
gen.ext.pp.list <- function(99, GR$n, type="CSR")
{
# create a blank list at the top level environment
my.pp.list <<- c() # should be equivalent to <<- NULL
# now popoulate it with the appropriate patterns.
for (i in 1:99)
if (type=="CSR")
my.pp.list[[i]] <<- runifpoint(GR$n)
else # for now, just have an inhibition option
my.pp.list[[i]] <<- rSSI(r=0.0045, n=GR$n,
giveup=10000)
# lastly, create the top level index to the pattern list
pp.indx <<- 1
# nothing to return because the list is created externally.
return(0)
}
>Error: object 'type' not found
Thank you very much in advance,
Best,
-----
Aurelie Cosandey-Godin
Ph.D. Student, Department of Biology, Dalhousie University
Industrial Graduate Fellow, WWF-Canada
Email: godina at dal.ca | Web: wormlab.biology.dal.ca
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Loosmore-and-Ford-2006-Goodness-of-fit-GoF-test-for-CSR-tp7332928p7332928.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list