Last data update: 2014.03.03

R: Optimizewd version of 'get.tau' for typed data
get.tau.typedR Documentation

Optimizewd version of get.tau for typed data

Description

Version of th e get.tau function that is optimized for statically typed data. That is data where we want the relationship between points of type A and points of type B

Usage

get.tau.typed(posmat, typeA = -1, typeB = -1, r = 1, r.low = rep(0,
  length(r)), comparison.type = "representative")

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

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 indepedent process

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.bootstrap; get.tau.typed.permute; get.tau

Examples

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 by time case occurs
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")

plot(r.mid,typed.tau,log="y",cex.axis=1.25,
     xlab="Distance (m)",ylab="Tau",cex.main=0.9,lwd=2,type="l")
abline(h=1,lty=2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IDSpatialStats)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IDSpatialStats/get.tau.typed.Rd_%03d_medium.png", width=480, height=480)
> ### Name: get.tau.typed
> ### Title: Optimizewd version of 'get.tau' for typed data
> ### Aliases: get.tau.typed
> 
> ### ** Examples
> 
> 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 by time case occurs
> 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")
> 
> plot(r.mid,typed.tau,log="y",cex.axis=1.25,
+      xlab="Distance (m)",ylab="Tau",cex.main=0.9,lwd=2,type="l")
> abline(h=1,lty=2)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>