spodt: Spatial Oblique Decision Tree main function

Description Usage Arguments Value Author(s) References See Also Examples

Description

The spodt function provides a spatial partionning.

Usage

1
2
spodt(formula, data, weight = FALSE, graft = 0,
      level.max = 5, min.parent = 10, min.child = 5, rtwo.min = 0.001)

Arguments

formula

a formula, with a response but no interaction terms. The left hand side has to contain the quantitative response variable. The right hand side should contain the quantitative and qualitative variables to be split according to a non oblique algorithm. For single spatial analysis (with no cofactor) the right hand side should be ~1.

data

a SpatialPointsDataFrame containing the coordinates and the variables. spodt needs planar coordinates. Geographic coordinates have to be projected. Otherwise, euclidian coordinates can be used.

weight

logical value indicating whether the interclass variances should be weighted or not.

graft

if not equals to 0, a numerical value in ]0;1] indicating the minimal modification of R2global requires to grafted the final classes.

level.max

the maximal level of the regression tree above which the splitting algorithm is stopped.

min.parent

the minimal size of a node below which the splitting algorithm is stopped.

min.child

the minimal size of the children classes below which the split is refused and algorithm is stopped.

rtwo.min

the minimal value of R2 above which the node split is refused and algorithm is stopped. Specified as a numerical value between 0 and 1.

Value

The spodt function computes an object of class spodt with the different components of the classification tree, i.e. i) at each step: the point locations within each class, the R2 coefficients of the splitting line; ii) global results: the R2global (object@R2), the final partition (object@partition) including the graft results.

Author(s)

Jean Gaudart, Nathalie Graffeo, Guillaume Barbet, Bernard Fichet, Roch Giorgi (Aix-Marseille University)

References

See Also

spodt.tree, spodtSpatialLines, test.spodt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(dataMALARIA)
#Example : number of malaria episodes per child at each household,
          #from November to December 2009, Bandiagara, Mali.
#Copyright: Pr Ogobara Doumbo, MRTC, Bamako, Mali. email: okd[at]icermali.org
coordinates(dataMALARIA)<-c("x","y")
class(dataMALARIA)
proj4string(dataMALARIA)<-"+proj=longlat +datum=WGS84 +ellps=WGS84"
dataMALARIA<-spTransform(dataMALARIA, CRS("+proj=merc +datum=WGS84 +ellps=WGS84"))

gr<-0.07   #graft parameter
rtw<-0.01 #rtwo.min
parm<-25  #min.parent
childm<-2 #min.child
lmx<-7 

sp<-spodt(dataMALARIA@data[,2]~1, dataMALARIA, weight=TRUE, graft=gr, min.ch=childm,
          min.parent=parm, level.max=lmx, rtwo.min=rtw)
sp
sp@R2

#the warning "root is a leaf" tells that no split can be provided by the
    # spodt function according to the splitting parameters

SPODT documentation built on May 2, 2019, 9:43 a.m.