Description Usage Arguments Details Examples
Convert standard tidy conjoint function (data, formula, id) input into the input for a 'brms' model.
1 | cjbae_formula(data, formula, id)
|
data |
A tidy, long-format conjoint dataframe. |
formula |
A formula specifying an AMCE/MM model, to be converted for bayesian analysis. All variables should be factors. |
id |
A variable, within data, containing respondent IDs. |
cjbae_formula
takes three arguments: 'data', 'formula', and 'id', and uses these to specify a formula to be passed to 'brm()', to facilitate bayesian analysis of conjoint experiments otherwise analysed using 'cregg'. This function is integrated into other 'cjbae()' functions and only necessary in isolation if you are directly using 'brms()'.
1 2 3 4 5 6 7 8 9 10 11 12 | #load example data from cregg
library(cregg)
data(immigration)
#with simple input formula
cjbae_formula(data = immigration, formula = ChosenImmigrant ~ Gender + Job, id = CaseID)
#or matched positionally
cjbae_formula(immigration, ChosenImmigrant ~ Gender + Job, CaseID)
#can pre-specify longer input formula
f1 <- ChosenImmigrant ~ Gender + Education + LanguageSkills +
CountryOfOrigin + Job + JobExperience + JobPlans +
ReasonForApplication + PriorEntry
cjbae_formula(immigration, f1, CaseID)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.