findModel: Given a model name, return stanmodel object

View source: R/fit.R

findModelR Documentation

Given a model name, return stanmodel object

Description

This is a convenience function to help you look up the path to an appropriate model for your data.

Usage

findModel(model = NULL)

Arguments

model

the name of a model

Details

There are essentially three models: ‘unidim’, ‘covariance’, and ‘factor’. ‘unidim’ analyzes a single item. ‘covariance’ is suitable for two or more items. Once you have vetted your items with the ‘unidim’ and ‘covariance’ models, then you can try the ‘factor’ model. For each model, there is a ‘_ll’ variation. This model includes row-wise log likelihoods suitable for feeding to loo for efficient approximate leave-one-out cross-validation (Vehtari, Gelman, & Gabry, 2017).

There is also a special model ‘unidim_adapt’. Except for this model, the other models require a scaling constant. To find an appropriate scaling constant, we recommend fitting ‘unidim_adapt’ to each item separately and then take the median of median point estimates to set the scale. ‘unidim_adapt’ requires a varCorrection constant. In general, a varCorrection of 2.0 or 3.0 should provide optimal results.

Since version 1.1.0, the factor model permits an arbitrary number of factors and arbitrary factor-to-item paths. If you were using the old factor model, you'll need to update your code to call prepSingleFactorModel. Arbitrary factor model structure should be specified using prepFactorModel. The single factor model is called ‘factor1’ and the general factor model is called ‘factor’.

Value

An instance of S4 class stanmodel that can be passed to pcStan.

References

Vehtari A, Gelman A, Gabry J (2017). "Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC." Statistics and Computing, 27, 1413-1432. doi: 10.1007/s11222-016-9696-4

See Also

toLoo

Examples

findModel()  # shows available models
findModel('unidim')

pcFactorStan documentation built on Sept. 14, 2023, 1:09 a.m.