get.theta.ci {IDSpatialStats}R Documentation

Calculate bootstrapped confidence intervals for get.theta values.

Description

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

Usage

get.theta.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 we 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.theta: get.theta(), get.theta.bootstrap(), get.theta.permute(), get.theta.typed(), get.theta.typed.bootstrap(), get.theta.typed.permute()

Examples



#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

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

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



[Package IDSpatialStats version 0.4.0 Index]