Description Usage Arguments Value Author(s) See Also Examples
Wrapper to get.tau.bootstrap
that takes care of calulating
the confidence intervals based on the bootstrapped values
1 2 3 4 5 6 7 8 9 10 11 | get.tau.ci(
posmat,
fun,
r = 1,
r.low = rep(0, length(r)),
boot.iter = 1000,
comparison.type = "representative",
ci.low = 0.025,
ci.high = 0.975,
data.frame = TRUE
)
|
posmat |
a matrix appropriate for input to |
fun |
a function appropriate as input to |
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 |
comparison.type |
the comparison type to pass to get.tau |
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 data frame with the point estimate of tau and its low and high confidence interval at each distance
Justin Lessler and Henrik Salje
Other get.tau:
get.tau.bootstrap()
,
get.tau.permute()
,
get.tau.typed.bootstrap()
,
get.tau.typed.permute()
,
get.tau.typed()
,
get.tau()
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
tau <- get.tau.ci(x,fun,r=r.max,r.low=r.min,boot.iter=50)
plot(r.mid, tau$pt.est, ylim=c(1/max(tau[,3:5]), max(tau[,3:5])), type="l", log="y",
xlab="Distance", ylab="Tau")
lines(r.mid, tau$ci.low , lty=2)
lines(r.mid, tau$ci.high, lty=2)
lines(c(0,100),c(1,1), lty=3, col="grey")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.