plot_profiles: Plot variable means and variances by profile for mclust...

Description Usage Arguments Details Examples

View source: R/plot_profiles.R

Description

Plot variable means and variances by profile for mclust output

Usage

1
2
plot_profiles(x, to_center = F, to_scale = F, plot_what = "tibble",
  plot_error_bars = TRUE, plot_rawdata = TRUE, ci = 0.95)

Arguments

x

output from estimate_profiles()

to_center

whether to center the data before plotting

to_scale

whether to scale the data before plotting

plot_what

whether to plot tibble or mclust output from estimate_profiles(); defaults to tibble

plot_error_bars

whether to plot error bars (representing the 95 percent confidence interval for the mean of each variable)

plot_rawdata

whether to plot raw data; defaults to TRUE

ci

confidence interval to plot (defaults to 0.95)

Details

Plot the variable means and variances for data frame output from estimate_profiles()

Plot the variable means and variances for data frame output from estimate_profiles(). When plot_what is set to 'mclust', the errorbars represent non-parametric confidence intervals, obtained using bootstrapping (100 samples). Note that 100 samples might be adequate for plotting, but is low for inference. If the number of participants per class is highly unbalanced (specifically, if the number of participants assigned to one class is less than .5*(1/number of classes), then weighted likelihood bootstrapping is used to ensure that each case is represented in the bootstrap samples (see O’Hagan, Murphy, Scrucca, and Gormley, 2015).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
m3 <- estimate_profiles(iris,
    Sepal.Length, Sepal.Width, Petal.Length, Petal.Width,
    model = 1,
    n_profiles = 3)
plot_profiles(m3)

m3 <- estimate_profiles(iris,
    Sepal.Length, Sepal.Width, Petal.Length, Petal.Width,
    model = 1,
    n_profiles = 3, to_return = "mclust")
plot_profiles(m3, plot_what = "mclust")

jrosen48/tidyLPA documentation built on July 19, 2018, 5:34 a.m.