Spaghetti.Plot

0th

Percentile

Make a Spaghetti plot

Makes a spaghetti plot, i.e., a plot that depicts the outcome as a function of time for each individual subject.

Keywords
Exploratory analysis, Individual profiles, Mean structure
Usage
Spaghetti.Plot(Dataset, Outcome, Time, Id, Add.Profiles=TRUE, Add.Mean=TRUE, 
Add.Median=FALSE, Col=8, Lwd.Me=3, xlim, ylim, ...)
Arguments
Dataset

A data.frame that should consist of multiple lines per subject ('long' format).

Outcome

The name of the outcome variable.

Time

The name of the time indicator.

Id

The subject indicator.

Add.Profiles

Logical. Should the individual profiles be added? Default Add.Profiles=TRUE.

Add.Mean

Logical. Should a line that depicts the mean as a function of time be added? Default Add.Mean=TRUE.

Add.Median

Logical. Should a line that depicts the medean as a function of time be added? Default Add.Mean=FALSE.

Col

The color of the individual profiles. Default Col=8 (grey).

Lwd.Me

The line width of the lines with mean and/or median. Default Lwd.Me=3.

xlim

The (min, max) values for the x-axis.

ylim

The (min, max) values for the y-axis.

...

Other arguments to be passed to the plot() function.

References

Van der Elst, W., Molenberghs, G., Hilgers, R., & Heussen, N. (2015). Estimating the reliability of repeatedly measured endpoints based on linear mixed-effects models. A tutorial. Submitted.

Aliases
  • Spaghetti.Plot
Examples
# NOT RUN {
# Open data
data(Example.Data)

# Plot individual profiles + mean
Spaghetti.Plot(Dataset = Example.Data, Outcome = Outcome, Id=Id, Time = Time)

# Plot individual profiles + median
Spaghetti.Plot(Dataset = Example.Data, Outcome = Outcome, Id=Id, Time = Time,
Add.Mean = FALSE, Add.Median = TRUE)
# }
Documentation reproduced from package CorrMixed, version 0.1-13, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.