prepFactorModel | R Documentation |
Specify a factor model with an arbitrary number of factors and arbitrary factor-to-item structure.
prepFactorModel(
data,
path,
factorScalePrior = deprecated(),
psiScalePrior = deprecated()
)
data |
a data list prepared for processing by Stan |
path |
a named list of item names |
factorScalePrior |
a named numeric vector (deprecated) |
psiScalePrior |
matrix of priors for factor correlations (deprecated) |
For each factor, you need to specify its name and which items it predicts. The connections from factors to items is specified by the 'path' argument. Both factors and items are specified by name (not index).
a data list suitable for passing as the data
argument to pcStan
or stan
To simulate data from a factor model: generateFactorItems
Other factor model:
prepSingleFactorModel()
Other data preppers:
prepCleanData()
,
prepData()
,
prepSingleFactorModel()
pa <- phyActFlowPropensity[,setdiff(colnames(phyActFlowPropensity),
c('goal1','feedback1'))]
dl <- prepData(pa)
dl <- prepFactorModel(dl,
list(flow=c('complex','skill','predict',
'creative', 'novelty', 'stakes',
'present', 'reward', 'chatter',
'body'),
f2=c('waiting','control','evaluated','spont'),
rc=c('novelty', 'waiting')))
str(dl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.