Conjoint tables (source = "conj") have one row per respondent, task
and profile: id, task, profile, the outcomes
(choice, rating, and any choice_<name> or
rating_<name>), the profile's attribute levels in attr_*
columns, and respondent covariates in cov_*. There is no item
or resp, because every profile is a new random bundle of attributes.
Usage
irw_conj_long(df, outcomes = NULL)
Arguments
- df
A conjoint table, as returned by
irw_fetch(name, source = "conj").
- outcomes
Optional character vector of outcome columns to keep. Default:
all of them.
Value
A data frame with columns id, item, resp,
trial_task, trial_profile, trial_attr_*, and the
remaining columns of df.
Details
This function stacks the outcomes into the core layout so that tools built
for id/item/resp can be used: item is the name of
the outcome question ("choice", "rating", ...), resp its
value, and task, profile and the attributes become
trial_ columns. Rows with a missing outcome are dropped.
Examples
if (FALSE) { # \dontrun{
d <- irw_fetch("kreps_2020_covid_vaccine", source = "conj")
long <- irw_conj_long(d)
table(long$item)
} # }