get.tau.typed.bootstrap: runs bootstrapping for 'get.tau.typed'

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spatialfuncs.r

Description

runs bootstrapping for get.tau.typed

Usage

1
2
3
get.tau.typed.bootstrap(posmat, typeA = -1, typeB = -1, r = 1,
  r.low = rep(0, length(r)), boot.iter,
  comparison.type = "representative", data.frame = TRUE)

Arguments

posmat

a matrix with columns type, x and y

typeA

the "from" type that we are interested in, -1 is wildcard

typeB

the "to" type that we are interested i, -1 is wildcard

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

what type of points are included in the comparison set.

  • "representative" if comparison set is representative of the underlying population

  • "independent" if comparison set is cases/events coming from an independent process

data.frame

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

Value

tau values for all the distances we looked at

Author(s)

Justin Lessler and Henrik Salje

See Also

Other get.tau: get.tau.bootstrap, get.tau.ci, get.tau.permute, get.tau.typed.permute, get.tau.typed, get.tau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
data(DengueSimulationR02)

r.max<-seq(20,1000,20)
r.min<-seq(0,980,20)
r.mid<-(r.max+r.min)/2

# Lets see if there's a difference in spatial dependence between those that occurred 
# late versus early in the outbreak

type <- 2 - (DengueSimR02[,"time"] < 120)
tmp <- cbind(DengueSimR02, type=type)

typed.tau <- get.tau.typed(tmp, typeA=1, typeB=2, r=r.max, r.low=r.min, 
                           comparison.type = "independent")

typed.tau.type.bs <- get.tau.typed.bootstrap(tmp, typeA=1, typeB=2, r=r.max, r.low=r.min, 
                                             boot.iter=100, comparison.type = "independent")

ci <- apply(typed.tau.type.bs[,-(1:2)], 1, quantile, probs=c(0.025,0.975))

plot(r.mid, typed.tau$tau, log="y",
     ylim=c(0.1,4), cex.axis=1.25,
     xlab="Distance (m)", ylab="Tau",
     cex.main=0.9, lwd=2, type="n")
abline(h=1,lty=1)
lines(r.mid,typed.tau$tau,pch=20,col=1,lwd=3)
lines(r.mid, ci[1,] , lty=2)
lines(r.mid, ci[2,] , lty=2)

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