Type: | Package |
Title: | Recursive Partitioning of Longitudinal Data |
Version: | 0.2.3 |
Author: | Ross Jacobucci [aut,cre], Sam Stewart[aut], Mohamed Abdolell [aut], Sarfaraz Serang [ctb], Gabriela Stegmann [ctb] |
Maintainer: | Ross Jacobucci <rcjacobuc@gmail.com> |
Depends: | R (≥ 2.10), nlme, ggplot2, rpart, formula.tools, MASS |
Suggests: | mgcv, rpart.plot |
Description: | Performs recursive partitioning of linear and nonlinear mixed effects models, specifically for longitudinal data. The package is an extension of the original 'longRPart' package by Stewart and Abdolell (2013) https://cran.r-project.org/package=longRPart. |
License: | GPL-2 | GPL-3 [expanded from: GPL] |
RoxygenNote: | 6.0.1 |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2018-01-19 14:07:09 UTC; rjacobuc |
Repository: | CRAN |
Date/Publication: | 2018-01-19 14:25:48 UTC |
A dataset used as an example for longRPart2
Description
A dataset used as an example for longRPart2
Usage
ex.data.3
Format
A data frame with 600 rows and 4 variables:
- id
id number
- z
covariate
- time
time variable
- y
outcome
...
Longitudinal data with groups
Description
A saved image with rp object
Usage
lcart.mod1
Format
An object of class "lrp"
Trying to suppress notes from lrp2Plot
Description
Trying to suppress notes from lrp2Plot
Longitudinal Recursive Partitioning
Description
Longitudinal Recursive Partitioning
Usage
lrp(method, nlme.model = NULL, randomFormula, fixedFormula = NULL, data,
start, group, rPartFormula, weight = NULL, R = NULL, min.dev = NULL,
control = rpart.control())
Arguments
method |
Whether to use lme() or nlme(). Use either method="lme" or method="nlme". This changes what additional arguments need to be passed. |
nlme.model |
Necessary to specify if method="nlme" |
randomFormula |
Random effects to include for nlme() or lme() |
fixedFormula |
Fixed effects to include for nlme() or lme() |
data |
Dataset |
start |
Starting values for nlme() |
group |
Grouping for nlme() |
rPartFormula |
Not sure yet |
weight |
Sample weights to be passed to rpart |
R |
Correlation matrix to use for nlme. this is correlation= |
min.dev |
The minimum decrease in deviance to choose a split. Note that this overrides the default cp criterion in rpart.control() |
control |
Control function to be passed to rpart() |
Examples
library(longRPart2)
data(ex.data.3)
model.0 = nlme(y~b0i+b1i*time,
data=ex.data.3,
fixed=b0i+b1i~1,
random=b0i+b1i~1,
group=~id,
start=c(10,5))
lcart.mod1 <- lrp(method="nlme",
nlme.model=y~b0i+b1i*time,
fixedFormula=b0i+b1i~1,
rPartFormula = ~ z,
group= ~ id,
randomFormula=b0i+b1i~1,
data=ex.data.3,
start=c(10,5))
data(lcart.mod1)
summary(lcart.mod1)
plot(lcart.mod1)
#lrp2Plot(lcart.mod1)
Longitudinal Recursive Partitioning Plotting Function
Description
Longitudinal Recursive Partitioning Plotting Function
Usage
lrp2Plot(model, smooth_method = "loess")
Arguments
model |
A longrpart2 model. |
smooth_method |
Whether to use generalized additive models, smooth_method="gam", or loess, smooth_method="loess". Defaults to loess. |
Examples
library(longRPart2)
Plot Expected Trajectories
Description
Plot Expected Trajectories
Usage
lrpPlot(model, smoothing = "n", color = NULL, place = "bottomright")
Arguments
model |
Model object from longRPart2() |
smoothing |
Type of smoothing for trajectoris |
color |
Color to use |
place |
Where to place the plot |
Plot function for longRPart2
Description
Plot function for longRPart2
Usage
## S3 method for class 'lrp'
plot(x, ...)
Arguments
x |
A model from lrp. |
... |
Other arguments. |
Summary results from lrp.
Description
Summary results from lrp.
Usage
## S3 method for class 'lrp'
summary(object, ...)
Arguments
object |
An object from lrp. |
... |
Other arguments. |