Description Usage Arguments Value Author(s) See Also Examples
Wrapper to get.theta.bootstrap
that takes care of calculating the
confience intervals based on the bootstrapped values.
1 2 3 4 5 6 7 8 9 10 | 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
)
|
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) |
a matrix with a row for the high and low values and a column per distance
Justin Lessler
Other get.theta:
get.theta.bootstrap()
,
get.theta.permute()
,
get.theta.typed.bootstrap()
,
get.theta.typed.permute()
,
get.theta.typed()
,
get.theta()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.