get.pi.ci: Calculate bootstrapped confidence intervals for 'get.pi'...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spatialfuncs.r

Description

Wrapper to get.pi.bootstrap that takes care of calculating the confidence intervals based on the bootstrapped values..

Usage

1
2
3
get.pi.ci(posmat, fun, r = 1, r.low = rep(0, length(r)),
  boot.iter = 1000, ci.low = 0.025, ci.high = 0.975,
  data.frame = TRUE)

Arguments

posmat

a matrix with columns type, x and y

fun

the function to decide relationships

r

the series of spatial distances wer are interested in

r.low

the low end of each range. 0 by default

boot.iter

the number of bootstrap iterations

ci.low

the low end of the ci...0.025 by default

ci.high

the high end of the ci...0.975 by default

data.frame

logical indicating whether to return results as a data frame (default = TRUE)

Value

a matrix with a row for the high and low values and a column per distance

Author(s)

Justin Lessler

See Also

Other get.pi: get.pi.bootstrap, get.pi.permute, get.pi.typed.bootstrap, get.pi.typed.permute, get.pi.typed, get.pi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#compare normally distributed with uniform points
x<-cbind(1,runif(100,-100,100), runif(100,-100,100))
x<-rbind(x, cbind(2,rnorm(100,0,20), rnorm(100,0,20)))
colnames(x) <- c("type","x","y")

fun<-function(a,b) {
    if(a[1]!=2) return(3)
    if (b[1]==2) return(1)
    return(2)
}

r.max<-seq(10,100,10)
r.min<-seq(0,90,10)
r.mid <- (r.max+r.min)/2


pi<-get.pi(x,fun,r=r.max,r.low=r.min)
pi.ci<-get.pi.ci(x,fun,r=r.max,r.low=r.min,boot.iter=100)

plot(r.mid, pi$pi, type="l")
lines(r.mid, pi.ci[,2] , lty=2)
lines(r.mid, pi.ci[,3] , lty=2)

IDSpatialStats documentation built on Nov. 16, 2019, 1:08 a.m.