wide_conjoint {cregg}R Documentation

Example of a raw, “wide” conjoint dataset to demonstrate functionality of cj_tidy

Description

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.

Usage

data(wide_conjoint)

Format

A data frame with 100 observations on the following variables:

‘⁠respondent⁠’

a numeric vector indicating the respondent identifier

‘⁠feature1a1⁠’

Feature 1 for task A left profile, a factor

‘⁠feature1b1⁠’

Feature 1 for task B left profile, a factor

‘⁠feature1c1⁠’

Feature 1 for task C left profile, a factor

‘⁠feature1d1⁠’

Feature 1 for task D left profile, a factor

‘⁠feature1a2⁠’

Feature 1 for task A right profile, a factor

‘⁠feature1b2⁠’

Feature 1 for task B right profile, a factor

‘⁠feature1c2⁠’

Feature 1 for task C right profile, a factor

‘⁠feature1d2⁠’

Feature 1 for task D right profile, a factor

‘⁠feature2a1⁠’

Feature 2 for task A left profile, a factor

‘⁠feature2b1⁠’

Feature 2 for task B left profile, a factor

‘⁠feature2c1⁠’

Feature 2 for task C left profile, a factor

‘⁠feature2d1⁠’

Feature 2 for task D left profile, a factor

‘⁠feature2a2⁠’

Feature 2 for task A right profile, a factor

‘⁠feature2b2⁠’

Feature 2 for task B right profile, a factor

‘⁠feature2c2⁠’

Feature 2 for task C right profile, a factor

‘⁠feature2d2⁠’

Feature 2 for task D right profile, a factor

‘⁠feature3a1⁠’

Feature 3 for task A left profile, a factor

‘⁠feature3b1⁠’

Feature 3 for task B left profile, a factor

‘⁠feature3c1⁠’

Feature 3 for task C left profile, a factor

‘⁠feature3d1⁠’

Feature 3 for task D left profile, a factor

‘⁠feature3a2⁠’

Feature 3 for task A right profile, a factor

‘⁠feature3b2⁠’

Feature 3 for task B right profile, a factor

‘⁠feature3c2⁠’

Feature 3 for task C right profile, a factor

‘⁠feature3d2⁠’

Feature 3 for task D right profile, a factor

‘⁠choice_a⁠’

outcome for task A indicating which profile was chosen, randomly 1 or 2, each equally probable

‘⁠choice_b⁠’

outcome for task B indicating which profile was chosen, randomly 1 or 2, each equally probable

‘⁠choice_c⁠’

outcome for task C indicating which profile was chosen, randomly 1 or 2, each equally probable

‘⁠choice_d⁠’

outcome for task D indicating which profile was chosen, randomly 1 or 2, each equally probable

‘⁠rating_a1⁠’

rating for task A left profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_a2⁠’

rating for task A right profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_b1⁠’

rating for task B left profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_b2⁠’

rating for task B right profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_c1⁠’

rating for task C left profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_c2⁠’

rating for task C right profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_d1⁠’

rating for task D left profile, random variable between 1 and 7, uniformly distributed

‘⁠rating_d2⁠’

rating for task D right profile, random variable between 1 and 7, uniformly distributed

‘⁠timing_a⁠’

timing for task A in seconds, random draws from a beta distribution (2,5) times 10

‘⁠timing_b⁠’

timing for task A in seconds, random draws from a beta distribution (2,5) times 10

‘⁠timing_c⁠’

timing for task A in seconds, random draws from a beta distribution (2,5) times 10

‘⁠timing_d⁠’

timing for task A in seconds, random draws from a beta distribution (2,5) times 10

‘⁠covariate1⁠’

random draws from a uniform distribution between -1 and 1

‘⁠covariate2⁠’

random draws from the set of 1 and 2

See Also

cj_tidy cj

Examples

## Not run: 
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))

## End(Not run)

[Package cregg version 0.4.0 Index]