Learn R Programming

ctsem (version 3.2.1)

ctStanContinuousPars: ctStanContinuousPars

Description

Returns the continuous time parameter matrices for specified subjects of a ctStanFit fit object

Usage

ctStanContinuousPars(
  ctstanfitobj,
  subjects = "all",
  iter = "all",
  calcfunc = quantile,
  calcfuncargs = list(probs = 0.5)
)

Arguments

ctstanfitobj

fit object from ctStanFit

subjects

Either 'all', or integers denoting which subjects to perform the calculation over. When multiple subjects are specified, the returned matrices will be a mean over subjects.

iter

Either character string 'all' which will then use all post-warmup iterations, or an integer specifying which iteration/s to use.

calcfunc

Function to apply over samples, must return a single value. By default the median over all samples is returned using the quantile function, but one might also be interested in the mean or sd, for instance.

calcfuncargs

A list of additional parameters to pass to calcfunc. For instance, with the default of calcfunc = quantile, the probs argument is needed to ensure only a single value is returned.

Examples

Run this code
# NOT RUN {
if (!exists("ctstantestfit")) example(ctstantestfit)
#posterior median over all subjects (also reflects mean of unconstrained pars)
ctStanContinuousPars(ctstantestfit)

#posterior 97.5% quantiles for subject 2
ctStanContinuousPars(ctstantestfit, subjects=2, calcfunc=quantile, 
calcfuncargs=list(probs=0.975))
# }

Run the code above in your browser using DataLab