ctsem (version 3.0.4)

stan_confidenceRegion: Extract functions of multiple variables from a stanfit object

Description

Can be useful for determining quantiles or plotting multidimensional regions -- for instance in case of colinearity of predictors.

Usage

stan_confidenceRegion(stanfit, parstrings, prefuncstring = "(",
  joinfuncstring = " + ", postfuncstring = ")")

Arguments

stanfit

object of class stanfit.

parstrings

vector of strings containing partial (or full) matches of parameter names. When more than one string is passed, functions are computed based on the combination of the first match for each string, then the second match for each string, etc. The first match of the first string is only ever combined with the first match of the second, similarly for the 2nd match, etc.

prefuncstring

string containing front element of function. E.g., 'exp(' for an exponential region.

joinfuncstring

string used to join the (possibly) multiple parameters involved.

postfuncstring

string containing end element of function. E.g., ') *2' to multiply the result by 2.

Value

matrix of values of the specified interactions at each iteration.

Examples

Run this code
# NOT RUN {
temp<-stan_confidenceRegion(stanfit=ctstantestfit$stanfit, 
  parstrings=c('pop_DRIFT[1,2]','pop_DRIFT[2,1]'))
t(apply(temp,2,quantile))
# }

Run the code above in your browser using DataCamp Workspace