Learn R Programming

CoTiMA (version 0.7.0)

ctmaPlotCtsemMod: ctmaPlotCtsemMod

Description

Plots moderator models using ctsem fit objects

Usage

ctmaPlotCtsemMod(
  ctStanFitObject = NULL,
  fitSummary = NULL,
  activeDirectory = NULL,
  Tipred.pos = 1,
  saveFilePrefix = "Moderator Plot ",
  scaleTime = 1,
  mod.sd.to.plot = -1:1,
  timeUnit = "not specified",
  timeRange = NULL,
  mod.type = "cont",
  no.mod.cats = NULL,
  n.x.labels = NULL,
  plot.xMin = 0,
  plot.xMax = NULL,
  plot.yMin = -1,
  plot.yMax = 1,
  plot..type = "l",
  plot.lty = 1,
  plot.col = "grey",
  plot.lwd = 1.5,
  dot.plot.type = "b",
  dot.plot.col = "black",
  dot.plot.lwd = 0.5,
  dot.plot.lty = 3,
  dot.plot.pch = 16,
  dot.plot.cex = 3
)

Value

writes png figures to disc using the path specified in the activeDirectory arguments.

Arguments

ctStanFitObject

The fit object with moderator (TIpred) effects to be plotted

fitSummary

Mainl ofr debugging purpose. Saves computation time if provided in addition to the fit object

activeDirectory

defines the active directory (where to save plots)

Tipred.pos

the Tipred that represent the moderator. Could be more than one in case of categorical moderators (e.g., Tipred.pos = c(3,4))

saveFilePrefix

Prefix used for saved plots

scaleTime

factor to increase or decrease the time scale (e.g., 1/12 if estimates where based on yearly intervals and figure should show monthly intervals)

mod.sd.to.plot

The standard deviation vlaues (default -1, 0, +1) for which the drift effects are plotted

timeUnit

Label for the x-axis

timeRange

time range across which drift effects are plotted

mod.type

Could be either "cont" or "cat"

no.mod.cats

Need to be specified if type = "cat". The number of categories should usually be equal the number of dummy variables used to represent the categorical moderator + 1.

n.x.labels

How many values to be used for indicating time points on the x-axis (0 is automatically added and should not be counted)

plot.xMin

default = 0

plot.xMax

default = NULL

plot.yMin

default = -1

plot.yMax

default = 1

plot..type

default = "l", # 2 dots .. are correct

plot.lty

default = 1

plot.col

default = "grey"

plot.lwd

default = 1.5

dot.plot.type

default = "b" for the dots indicating the moderator values

dot.plot.col

default ="black" for the dots indicating the moderator values

dot.plot.lwd

default = .5 for the dots indicating the moderator values

dot.plot.lty

default = 3 for the dots indicating the moderator values

dot.plot.pch

default = 16 for the dots indicating the moderator values

dot.plot.cex

default = 3 for the dots indicating the moderator values