ctsem (version 3.0.4)

ctStanDiscretePars: ctStanDiscretePars

Description

Calculate model implied regressions for a sequence of time intervals based on a continuous time model fit from ctStanFit, for specified subjects.

Usage

ctStanDiscretePars(ctstanfitobj, subjects = "all", times = seq(from =
  0, to = 10, by = 0.1), quantiles = c(0.025, 0.5, 0.975),
  nsamples = 500, observational = FALSE, standardise = FALSE,
  plot = FALSE, ...)

Arguments

ctstanfitobj

Continuous time model fit from ctStanFit

subjects

Either 'all', to take the average over all subjects, or a vector of integers denoting which subjects.

times

Numeric vector of positive values, discrete time parameters will be calculated for each.

quantiles

Which quantiles to return. If plotting, specify 3 quantiles, the 2nd will be plotted as a line with 1 and 3 as uncertainty bounds.

nsamples

Number of samples from the stanfit to use for plotting. Higher values will increase smoothness / accuracy, at cost of plotting speed. Values greater than the total number of samples will be set to total samples.

observational

Logical. If TRUE, outputs expected change in processes *conditional on observing* a 1 unit change in each -- this change is correlated according to the DIFFUSION matrix. If FALSE, outputs expected regression values -- also interpretable as an independent 1 unit change on each process, giving the expected response under a 1 unit experimental impulse.

standardise

Logical. If TRUE, output is standardised according to expected total within subject variance, given by the asymDIFFUSION matrix.

plot

Logical. If TRUE, plots output using ctStanDiscreteParsPlot instead of returning output.

...

additional plotting arguments to control ctStanDiscreteParsPlot

Examples

Run this code
# NOT RUN {
ctStanDiscretePars(ctstantestfit,times=seq(.5,4,.1), 
 plot=TRUE,indices='all')
# }

Run the code above in your browser using DataCamp Workspace