cj_tidy
R/wide_conjoint.R
wide_conjoint.Rd
A simulated dataset containing 100 respondents' responses to four decision tasks (a,b,c,d) involving a forced choice between two alternative profiles, described by three features (1,2,3), as well as a secondary rating-scale outcome and a response time measure, along with two respondent-varying covariates. This is used in testing and examples within the package.
data(wide_conjoint)
A data frame with 100 observations on the following variables:
a numeric vector indicating the respondent identifier
Feature 1 for task A left profile, a factor
Feature 1 for task B left profile, a factor
Feature 1 for task C left profile, a factor
Feature 1 for task D left profile, a factor
Feature 1 for task A right profile, a factor
Feature 1 for task B right profile, a factor
Feature 1 for task C right profile, a factor
Feature 1 for task D right profile, a factor
Feature 2 for task A left profile, a factor
Feature 2 for task B left profile, a factor
Feature 2 for task C left profile, a factor
Feature 2 for task D left profile, a factor
Feature 2 for task A right profile, a factor
Feature 2 for task B right profile, a factor
Feature 2 for task C right profile, a factor
Feature 2 for task D right profile, a factor
Feature 3 for task A left profile, a factor
Feature 3 for task B left profile, a factor
Feature 3 for task C left profile, a factor
Feature 3 for task D left profile, a factor
Feature 3 for task A right profile, a factor
Feature 3 for task B right profile, a factor
Feature 3 for task C right profile, a factor
Feature 3 for task D right profile, a factor
outcome for task A indicating which profile was chosen, randomly 1 or 2, each equally probable
outcome for task B indicating which profile was chosen, randomly 1 or 2, each equally probable
outcome for task C indicating which profile was chosen, randomly 1 or 2, each equally probable
outcome for task D indicating which profile was chosen, randomly 1 or 2, each equally probable
rating for task A left profile, random variable between 1 and 7, uniformly distributed
rating for task A right profile, random variable between 1 and 7, uniformly distributed
rating for task B left profile, random variable between 1 and 7, uniformly distributed
rating for task B right profile, random variable between 1 and 7, uniformly distributed
rating for task C left profile, random variable between 1 and 7, uniformly distributed
rating for task C right profile, random variable between 1 and 7, uniformly distributed
rating for task D left profile, random variable between 1 and 7, uniformly distributed
rating for task D right profile, random variable between 1 and 7, uniformly distributed
timing for task A in seconds, random draws from a beta distribution (2,5) times 10
timing for task A in seconds, random draws from a beta distribution (2,5) times 10
timing for task A in seconds, random draws from a beta distribution (2,5) times 10
timing for task A in seconds, random draws from a beta distribution (2,5) times 10
random draws from a uniform distribution between -1 and 1
random draws from the set of 1 and 2
if (FALSE) { data("wide_conjoint") # feature_variables list1 <- list( feature1 = list( names(wide_conjoint)[grep("^feature1.{1}1", names(wide_conjoint))], names(wide_conjoint)[grep("^feature1.{1}2", names(wide_conjoint))] ), feature2 = list( names(wide_conjoint)[grep("^feature2.{1}1", names(wide_conjoint))], names(wide_conjoint)[grep("^feature2.{1}2", names(wide_conjoint))] ), feature3 = list( names(wide_conjoint)[grep("^feature3.{1}1", names(wide_conjoint))], names(wide_conjoint)[grep("^feature3.{1}2", names(wide_conjoint))] ), rating = list( names(wide_conjoint)[grep("^rating.+1", names(wide_conjoint))], names(wide_conjoint)[grep("^rating.+2", names(wide_conjoint))] ) ) # task variables list2 <- list(choice = paste0("choice_", letters[1:4]), timing = paste0("timing_", letters[1:4])) str(cj_tidy(wide_conjoint, profile_variables = list1, task_variables = list2, id = ~ respondent)) }