gamtree  R Documentation 
gamtree
recursively partitions a dataset into subgroups with
penalized GAMs, characterized by differences in the parameter estimates.
gamtree(
formula,
data,
weights = NULL,
REML = TRUE,
method = "mob",
cluster = NULL,
offset = NULL,
verbose = FALSE,
parm = c(1, 2, 4),
gam_ctrl = list(),
tree_ctrl = list(),
alt_formula = NULL,
...
)
formula 
specifies the model formula, consisting of three
parts: the response variable followed by a tilde ('~'); the terms for the
nodespecific GAMs, followed by a vertical bar ('') and the potential
partitioning variables (separated by a '+').
The 'by' argument of function

data 

weights 
numeric vector of length 
REML 
logical, defaults to 
method 
character, one of 
cluster 
optional, a name refering to a colum of 
offset 
numeric vector of length 
verbose 
logical. Should progress be printed to the commande line in every iteration? If true, the iteration number, information on the splitting procedure, and the loglikelihood (with df) value of the fitted full mixedeffects gam model is printed. 
parm 
vector of one or more integers, indicating which parameters should be
included in the parameter stability tests. The default 
gam_ctrl 
a list of fit control parameters to replace defaults returned by

tree_ctrl 
a 
alt_formula 
list with two elements, for specifying nonstandard model formulae
for GAM. E.g., the formula list required for use of the 
... 
additional arguments to be passed to function 
MOB is short for modelbased recursive
partitioning, ctree is short for conditional inference tree. MOB is
based more strongly on parametric theory, thereby allowing for easy inclusion
of clustering structures into the estimation procedure (see also argument
cluster
), yielding similar to a GEEtype approach for estimation of
multilevel and longitudinal data structures. Yet, computation time for MOB is much
larger than for ctree, which is mostly due to how it searches for
the optimal splitting value, after the variable for splitting
has been selected. ctree uses tests based on permutation theory,
and thereby offers a less parametrically oriented approach. It is much
faster than MOB, but does not provide a natural way of accounting
for multilevel or longitudinal data structures.
Returns an object of class "gamtree"
. This is a list, containing
(amongst others) the GAMbased recursive partition (in $tree
).
The following methods are available to extract information from the fitted object:
predict.gamtree
, for obtaining predicted values for training and new
observations; plot.gamtree
for plotting the tree and variables' effects;
coef.gamtree
, fixef.gamtree
and ranef.gamtree
for extracting estimated coefficients. VarCorr.gamtree
for extracting
randomeffects (co)variances, summary.gamtree
for a summary of the
fitted models.
predict.gamtree
plot.gamtree
coef.gamtree
summary.gamtree
gt_m < gamtree(Pn ~ s(PAR, k = 5L)  Species, data = eco, cluster = Specimen)
summary(gt_m)
gt_c < gamtree(Pn ~ s(PAR, k = 5L)  Species, data = eco, method = "ctree")
summary(gt_c)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.