Computes and plots combined effects and quantiles for effects of time independent predictors on subject level parameters of a ctStanFit object.
ctStanTIpredeffects(fit, returndifference = FALSE, probs = c(0.025, 0.5,
0.975), whichTIpreds = 1, whichpars = "all", plot = FALSE, ...)
fit object from ctStanFit
logical. If FALSE, absolute parameter values are returned. If TRUE, only the effect of the covariate (i.e. without the average value of the parameter) are returned. The former can be easier to interpret, but the latter are more likely to fit on a single plot.
numeric vector of quantile probabilities from 0 to 1. Specify 3 values if plotting, the 2nd will be drawn as a line with uncertainty polygon based on 1st and 3rd.
integer vector specifying which of the tipreds in the fit object you want to
use to calculate effects. Unless quadratic / higher order versions of predictors have been
included, selecting more than one probably doesn't make sense. If for instance a squared
predictor has been included, then you can specify both the linear and squared version.
The x axis of the plot (if generated) will be based off the first indexed predictor. To
check what predictors are in the model, run fit$ctstanmodel$TIpredNames
.
Integer vector specifying Which of the individually varying subject
level parameters to compute effects on.
'auto' uses all available, which is equivalent to
1:sum(fit$ctstanmodel$pars$indvarying)
.
The integer corresponding to specific parameters can be found as follows, replacing fit
as appropriate:
fit$ctstanmodel$pars[sf$ctstanmodel$pars$indvarying,'param']
.
Logical. If TRUE, nothing is returned but instead ctPlotArray
is used to plot the output instead.
arguments to pass to ctPlotArray
for plotting.
Either a three dimensional array of predictor effects, or nothing with a plot generated.
# NOT RUN {
ctStanTIpredeffects(ctstantestfit,plot=TRUE)
# }
Run the code above in your browser using DataLab