Fit beta regression trees via modelbased recursive partitioning.
1 2 3 4 
formula 
symbolic description of the model of type 
partition 
symbolic description of the partitioning variables,
e.g., 
data, subset, na.action, weights, offset, cluster 
arguments controlling
data/model processing passed to 
link 
character specification of the link function in
the mean model (mu). Currently, 
link.phi 
character specification of the link function in
the precision model (phi). Currently, 
control 
a list of control arguments for the beta regression specified via

... 
further control arguments for the recursive partitioning
passed to 
Beta regression trees are an application of modelbased recursive partitioning
(implemented in mob
, see Zeileis et al. 2008) to
beta regression (implemented in betareg
, see CribariNeto
and Zeileis 2010). See also Grün at al. (2012) for more details.
Various methods are provided for "betatree"
objects, most of them
inherit their behavior from "mob"
objects (e.g., print
, summary
,
coef
, etc.). The plot
method employs the node_bivplot
panelgenerating function.
betatree()
returns an object of S3 class "betatree"
which
inherits from "modelparty"
.
CribariNeto, F., and Zeileis, A. (2010). Beta Regression in R. Journal of Statistical Software, 34(2), 1–24. http://www.jstatsoft.org/v34/i02/.
Grün, B., Kosmidis, I., and Zeileis, A. (2012). Extended Beta Regression in R: Shaken, Stirred, Mixed, and Partitioned. Journal of Statistical Software, 48(11), 1–25. http://www.jstatsoft.org/v48/i11/.
Zeileis, A., Hothorn, T., and Hornik K. (2008). ModelBased Recursive Partitioning. Journal of Computational and Graphical Statistics, 17(2), 492–514.
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 29 30 31 32 33 34 35 36 37  options(digits = 4)
## data with two groups of dyslexic and nondyslexic children
data("ReadingSkills", package = "betareg")
## additional random noise (not associated with reading scores)
set.seed(1071)
ReadingSkills$x1 < rnorm(nrow(ReadingSkills))
ReadingSkills$x2 < runif(nrow(ReadingSkills))
ReadingSkills$x3 < factor(rnorm(nrow(ReadingSkills)) > 0)
## fit beta regression tree: in each node
##  accurcay's mean and precision depends on iq
##  partitioning is done by dyslexia and the noise variables x1, x2, x3
## only dyslexia is correctly selected for splitting
bt < betatree(accuracy ~ iq  iq, ~ dyslexia + x1 + x2 + x3,
data = ReadingSkills, minsize = 10)
plot(bt)
## inspect result
coef(bt)
summary(bt, node = 2)
summary(bt, node = 3)
library("strucchange")
sctest(bt)
## add a numerical variable with relevant information for splitting
ReadingSkills$x4 < rnorm(nrow(ReadingSkills), c(1.5, 1.5)[ReadingSkills$dyslexia])
bt2 < betatree(accuracy ~ iq  iq, ~ x1 + x2 + x3 + x4,
data = ReadingSkills, minsize = 10)
plot(bt2)
## inspect result
coef(bt2)
sctest(bt2)
summary(bt2, node = 2)
summary(bt2, node = 3)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.