Learn R Programming

latrend (version 1.5.0)

qqPlot: Quantile-quantile plot

Description

Plot the quantile-quantile (Q-Q) plot for the fitted lcModel object. This function is based on the qqplotr package.

Usage

# S4 method for lcModel
qqPlot(object, byCluster = FALSE, ...)

Value

A ggplot object.

Arguments

object

The lcModel object.

byCluster

Whether to plot the Q-Q line per cluster

...

Additional arguments passed to qqplotr::geom_qq_band(), qqplotr::stat_qq_line(), and qqplotr::stat_qq_point().

See Also

residuals.lcModel metric plotClusterTrajectories

Examples

Run this code
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time", nClusters = 3)
model <- latrend(method, latrendData)

if (require("ggplot2") && require("qqplotr")) {
  qqPlot(model)
}

Run the code above in your browser using DataLab