plot.mplustree: Plots tree structure of an Mplus Tree

Description Usage Arguments Details Author(s) Examples

Description

Wrapper using rpart.plot package to plot the tree structure of a fitted Mplus Tree

Usage

1
2
## S3 method for class 'mplustree'
plot(x, ...)

Arguments

x

An object of class "mplustree" (a fitted Mplus Tree)

...

Other arguments passed to rpart.plot

Details

Each node of the plot by default contain the -2 log-likelihood (deviance), the number of individuals in the node, and the percentage of the total sample in the node.

Author(s)

Sarfaraz Serang, relying heavily on the rpart.plot package by Stephen Milborrow.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(lavaan)

script = mplusObject(
   TITLE = "Example #1 - Factor Model;",
   MODEL = "f1 BY x1-x3; f2 BY x4-x6; f3 BY x7-x9;",
   usevariables = c('x1','x2','x3','x4','x5','x6','x7','x8','x9'),
   rdata = HolzingerSwineford1939)

fit = MplusTrees(script, HolzingerSwineford1939, group=~id,
   rPartFormula=~sex+school+grade, control=rpart.control(cp=.01))

fit

plot(fit)

## End(Not run)

Rjacobucci/MplusTrees documentation built on July 5, 2019, 11:51 a.m.