getParam: Get Parameter Posterior Statistics

View source: R/getParam.R

getParamR Documentation

Get Parameter Posterior Statistics

Description

Returns posterior statistics (e.g., mean, median) for the parameters of a hierarchical MPT model.

Usage

getParam(fittedModel, parameter = "mean", stat = "mean", file = NULL)

Arguments

fittedModel

a fitted latent-trait MPT model (see traitMPT) or beta MPT model (see betaMPT)

parameter

which parameter(s) of the (hierarchical) MPT model should be returned? (see details in getParam).

stat

whether to get the posterior "mean", "median", "sd", or "summary" (includes mean, SD, and 95% credibility interval)

file

filename to export results in .csv format (e.g., file="est_param.csv")

Details

This function is a convenient way to get the information stored in fittedModel$mcmc.summ.

The latent-trait MPT includes the following parameters:

  • "mean" (group means on probability scale)

  • "mu" (group means on probit scale)

  • "sigma" (SD on probit scale)

  • "rho" (correlations on probit scale)

  • "theta" (individual MPT parameters)

The beta MPT includes the following parameters:

  • "mean" (group means on probability scale)

  • "sd" (SD on probability scale)

  • "alph","bet" (group parameters of beta distribution)

  • "theta" (individual MPT parameters)

Author(s)

Daniel Heck

See Also

getGroupMeans mean group estimates

Examples

## Not run: 
# mean estimates per person:
getParam(fittedModel, parameter = "theta")

# save summary of individual estimates:
getParam(fittedModel,
  parameter = "theta",
  stat = "summary", file = "ind_summ.csv"
)

## End(Not run)

TreeBUGS documentation built on May 31, 2023, 9:21 p.m.