Package palmtree. January 16, 2018

Similar documents
Package truncreg. R topics documented: August 3, 2016

Package rpst. June 6, 2017

Package mvprobit. November 2, 2015

Package GWRM. R topics documented: July 31, Type Package

Package glmmml. R topics documented: March 25, Encoding UTF-8 Version Date Title Generalized Linear Models with Clustering

Package vinereg. August 10, 2018

Package datasets.load

Package quint. R topics documented: September 28, Type Package Title Qualitative Interaction Trees Version 2.0.

Package bife. May 7, 2017

Subgroup identification for dose-finding trials via modelbased recursive partitioning

Package CompGLM. April 29, 2018

Package StVAR. February 11, 2017

Parties, Models, Mobsters: A New Implementation of Model-Based Recursive Partitioning in R

Package abe. October 30, 2017

Parties, Models, Mobsters A New Implementation of Model-Based Recursive Partitioning in R

Package sfa. R topics documented: February 20, 2015

Package SSLASSO. August 28, 2018

Package mtsdi. January 23, 2018

Package endogenous. October 29, 2016

Package RAMP. May 25, 2017

Package sqlscore. April 29, 2018

Package reghelper. April 8, 2017

The glmmml Package. August 20, 2006

Package apastyle. March 29, 2017

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package embed. November 19, 2018

Package quickreg. R topics documented:

Package rfsa. R topics documented: January 10, Type Package

Package PUlasso. April 7, 2018

Package dglm. August 24, 2016

Package hgam. February 20, 2015

Package CALIBERrfimpute

Package gppm. July 5, 2018

Package DCEM. September 30, 2018

Package PTE. October 10, 2017

Package estprod. May 2, 2018

Package sfc. August 29, 2016

Package ordinalnet. December 5, 2017

Package milr. June 8, 2017

Package glogis. R topics documented: March 16, Version Date

Package MIICD. May 27, 2017

Package Rtsne. April 14, 2017

Package reval. May 26, 2015

Package MOST. November 9, 2017

Package intccr. September 12, 2017

Package fastdummies. January 8, 2018

Package svalues. July 15, 2018

Package caic4. May 22, 2018

The grplasso Package

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

Package vip. June 15, 2018

Package fasttextr. May 12, 2017

Package PrivateLR. March 20, 2018

Package mnlogit. November 8, 2016

Package glmnetutils. August 1, 2017

Package projector. February 27, 2018

Package TANDEM. R topics documented: June 15, Type Package

Package MSwM. R topics documented: February 19, Type Package Title Fitting Markov Switching Models Version 1.

Package dalmatian. January 29, 2018

Package DTRreg. August 30, 2017

Package ADMM. May 29, 2018

Package optimus. March 24, 2017

Package BayesCR. September 11, 2017

Package simtool. August 29, 2016

Package modmarg. R topics documented:

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package mcemglm. November 29, 2015

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package gamlss.spatial

Package Formula. July 11, 2017

Package kirby21.base

Package sglr. February 20, 2015

Package clustvarsel. April 9, 2018

Package oasis. February 21, 2018

Package flexcwm. May 20, 2018

Package QCAtools. January 3, 2017

Package TVsMiss. April 5, 2018

The biglm Package. August 25, bigglm... 1 biglm Index 5. Bounded memory linear regression

Package robustgam. February 20, 2015

Package ssmn. R topics documented: August 9, Type Package. Title Skew Scale Mixtures of Normal Distributions. Version 1.1.

Package bayesdp. July 10, 2018

Package sgd. August 29, 2016

Package glinternet. June 15, 2018

Package colf. October 9, 2017

Package cwm. R topics documented: February 19, 2015

Package robustgam. January 7, 2013

Package PSTR. September 25, 2017

Package DRaWR. February 5, 2016

Package GLDreg. February 28, 2017

Package SEMrushR. November 3, 2018

Package mgc. April 13, 2018

Package clusterpower

Package BiDimRegression

Package stapler. November 27, 2017

Package FMsmsnReg. March 30, 2016

Package ArCo. November 5, 2017

Package citools. October 20, 2018

Package LTRCtrees. March 29, 2018

Package FWDselect. December 19, 2015

Package KRMM. R topics documented: June 3, Type Package Title Kernel Ridge Mixed Model Version 1.0 Author Laval Jacquin [aut, cre]

Transcription:

Package palmtree January 16, 2018 Title Partially Additive (Generalized) Linear Model Trees Date 2018-01-15 Version 0.9-0 Description This is an implementation of model-based trees with global model parameters (PALM trees). The PALM tree algorithm is an extension to the MOB algorithm (implemented in the 'partykit' package), where some parameters are fixed across all groups. Details about the method can be found in Seibold, Hothorn, Zeileis (2016) <arxiv:1612.07498>. The package offers coef(), loglik(), plot(), and predict() functions for PALM trees. Depends R (>= 3.1.0), partykit Imports Formula (>= 1.2-1) Suggests mvtnorm, psychotools License GPL-2 GPL-3 RoxygenNote 6.0.1 NeedsCompilation no Author Heidi Seibold [aut, cre] (0000-0002-8960-9642), Torsten Hothorn [aut] (0000-0001-8301-0471), Achim Zeileis [aut] (0000-0003-0918-3766) Maintainer Heidi Seibold <heidi@seibold.co> Repository CRAN Date/Publication 2018-01-16 15:15:40 UTC R topics documented: palmtree........................................... 2 Index 5 1

2 palmtree palmtree Partially Additive (Generalized) Linear Model Trees Description Model-based recursive partitioning based on (generalized) linear models with some local (i.e., leafspecific) and some global (i.e., constant throughout the tree) regression coefficients. Usage palmtree(formula, data, weights = NULL, family = NULL, lmstart = NULL, abstol = 0.001, maxit = 100, dfsplit = TRUE, verbose = FALSE, plot = FALSE,...) Arguments formula data weights family lmstart abstol maxit dfsplit verbose plot formula specifying the response variable and a three-part right-hand-side describing the local (i.e., leaf-specific) regressors, the global regressors (i.e., with constant coefficients throughout the tree), and partitioning variables, respectively. For details see below. data.frame to be used for estimating the model tree. numeric. An optional numeric vector of weights. (Note that this is passed with standard evaluation, i.e., it is not enough to pass the name of a column in data.) either NULL so that lm/lmtree are used or family specification for glm/glmtree. See glm documentation for families. numeric. A vector of length nrow(data), to be used as an offset in estimation of the first tree. NULL by default, which results in an initialization with the global model. numeric. The convergence criterion used for estimation of the model. When the difference in log-likelihoods of the model from two consecutive iterations is smaller than abstol, estimation of the model tree has converged. numeric. The maximum number of iterations to be performed in estimation of the model tree. logical or numeric. as.integer(dfsplit) is the degrees of freedom per selected split employed when extracting the log-likelihood. Should the log-likelihood value of the estimated model be printed for every iteration of the estimation? Should the tree be plotted at every iteration of the estimation? Note that selecting this option slows down execution of the function.... Additional arguments to be passed to lmtree() or glmtree(). See mob_control documentation for details.

palmtree 3 Details Value Partially additive (generalized) linear model (PALM) trees learn a tree where each terminal node is associated with different regression coefficients while adjusting for additional global regression effects. This allows for detection of subgroup-specific coefficients with respect to selected covariates, while keeping the remaining regression coefficients constant throughout the tree. The estimation algorithm iterates between (1) estimation of the tree given an offset of the global effects, and (2) estimation of the global regression effects given the tree structure. To specify all variables in the model a formula such as y ~ x1 + x2 x3 z1 + z2 + z3 is used, where y is the response, x1 and x2 are the regressors in every node of the tree, x3 has a global regression coefficients, and z1 to z3 are the partitioning variables considered for growing the tree. The code is still under development and might change in future versions. The function returns a list with the following objects: formula call tree palm data nobs loglik df dfsplit iterations maxit lmstart abstol intercept family The formula as specified with the formula argument. the matched call. The final lmtree/glmtree. The final lm/glm model. The dataset specified with the data argument including added auxiliary variables.lm and.tree from the last iteration. Number of observations. The log-likelihood value of the last iteration. Degrees of freedom. degrees of freedom per selected split as specified with the dfsplit argument. The number of iterations used to estimate the palmtree. The maximum number of iterations specified with the maxit argument. Offset in estimation of the first tree as specified in the lmstart argument. The prespecified value for the change in log-likelihood to evaluate convergence, as specified with the abstol argument. Logical specifying if an intercept was computed. The family object used. mob.control A list containing control parameters passed to lmtree(), as specified with.... References Sies A, Van Mechelen I (2015). Comparing Four Methods for Estimating Tree-Based Treatment Regimes. Unpublished Manuscript. See Also lm, glm, lmtree, glmtree

4 palmtree Examples ## one DGP from Sies and Van Mechelen (2015) dgp <- function(nobs = 1000, nreg = 5, creg = 0.4, ptreat = 0.5, sd = 1, coef = c(1, 0.25, 0.25, 0, 0, -0.25), eff = 1) { d <- mvtnorm::rmvnorm(nobs, mean = rep(0, nreg), sigma = diag(1 - creg, nreg) + creg) colnames(d) <- paste0("x", 1:nreg) d <- as.data.frame(d) d$a <- rbinom(nobs, size = 1, prob = ptreat) d$err <- rnorm(nobs, mean = 0, sd = sd) gopt <- function(d) { as.numeric(d$x1 > -0.545) * as.numeric(d$x2 < 0.545) } d$y <- coef[1] + drop(as.matrix(d[, paste0("x", 1:5)]) %*% coef[-1]) - eff * (d$a - gopt(d))^2 + d$err d$a <- factor(d$a) return(d) } set.seed(1) d <- dgp() ## estimate PALM tree with correctly specified global (partially ## additive) regressors and all variables considered for partitioning palm <- palmtree(y ~ a x1 + x2 + x5 x1 + x2 + x3 + x4 + x5, data = d) print(palm) plot(palm) ## query coefficients coef(palm, model = "tree") coef(palm, model = "palm") coef(palm, model = "all")

Index Topic tree palmtree, 2 coef.palmtree (palmtree), 2 glm, 2, 3 glmtree, 3 lm, 3 lmtree, 3 loglik.palmtree (palmtree), 2 mob_control, 2 palmtree, 2 plot.palmtree (palmtree), 2 predict.palmtree (palmtree), 2 print.palmtree (palmtree), 2 5