Description Usage Format See Also Examples
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.
1 |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## 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)
|
Classes ‘cj_df’ and 'data.frame': 800 obs. of 12 variables:
$ respondent: int 1 2 3 4 5 6 7 8 9 10 ...
$ covariate1: num 0.59 0.731 0.735 0.656 -0.302 ...
$ covariate2: int 2 1 2 2 1 2 2 1 1 1 ...
$ task : int 1 1 1 1 1 1 1 1 1 1 ...
$ profile : Factor w/ 2 levels "A","B": 1 1 1 1 1 1 1 1 1 1 ...
$ feature1 : Factor w/ 4 levels "Feature1_levela",..: 3 1 4 2 1 3 2 4 4 3 ...
$ feature2 : Factor w/ 6 levels "Feature2_levele",..: 1 1 4 1 3 2 4 5 3 3 ...
$ feature3 : Factor w/ 4 levels "Feature3_levelk",..: 1 2 2 1 2 3 3 2 3 4 ...
$ rating : int 1 4 2 1 7 7 3 2 3 3 ...
$ choice : num 2 1 2 2 2 1 1 2 1 2 ...
$ timing : num 5.28 4.1 3.81 2.82 2.99 ...
$ pair : int 1 2 3 4 5 6 7 8 9 10 ...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.