Conjoint analysis

conjoint(dataset, rvar, evar, int = "", by = "none", reverse = FALSE,
  data_filter = "", envir = parent.frame())

Arguments

dataset

Dataset

rvar

The response variable (e.g., profile ratings)

evar

Explanatory variables in the regression

int

Interaction terms to include in the model

by

Variable to group data by before analysis (e.g., a respondent id)

reverse

Reverse the values of the response variable (`rvar`)

data_filter

Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")

envir

Environment to extract data from

Value

A list with all variables defined in the function as an object of class conjoint

Details

See https://radiant-rstats.github.io/docs/multivariate/conjoint.html for an example in Radiant

See also

summary.conjoint to summarize results

plot.conjoint to plot results

Examples

conjoint(mp3, rvar = "Rating", evar = "Memory:Shape") %>% str()
#> List of 14 #> $ cdat :Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 18 obs. of 6 variables: #> ..$ Rating: int [1:18] 53 65 50 68 49 25 75 95 66 65 ... #> ..$ Memory: Factor w/ 3 levels "4GB","6GB","8GB": 1 2 1 3 3 2 2 3 1 2 ... #> ..$ Radio : Factor w/ 2 levels "No","Yes": 1 2 2 1 1 2 1 2 2 1 ... #> ..$ Size : Factor w/ 3 levels "Large","Medium",..: 3 2 2 1 3 1 3 1 3 2 ... #> ..$ Price : Factor w/ 3 levels "$50","$100","$150": 1 1 2 2 3 3 1 1 2 2 ... #> ..$ Shape : Factor w/ 3 levels "Circular","Rectangular",..: 3 3 3 3 3 3 1 1 1 1 ... #> ..- attr(*, "description")= chr "## MP3 player\n\n### Description\n\nConjoint data from one respondent. Ratings reflect the evaluation of 18 alt"| __truncated__ #> $ i : int 1 #> $ formula :Class 'formula' language Rating ~ Memory + Radio + Size + Price + Shape #> .. ..- attr(*, ".Environment")=<environment: 0xe9efd60> #> $ model_list :List of 1 #> ..$ full:List of 3 #> .. ..$ model:List of 13 #> .. .. ..$ coefficients : Named num [1:10] 58.11 7.67 29.67 6.11 6.33 ... #> .. .. .. ..- attr(*, "names")= chr [1:10] "(Intercept)" "Memory6GB" "Memory8GB" "RadioYes" ... #> .. .. ..$ residuals : Named num [1:18] -0.278 0.111 -0.389 0.389 -0.111 ... #> .. .. .. ..- attr(*, "names")= chr [1:18] "1" "2" "3" "4" ... #> .. .. ..$ effects : Named num [1:18] -217.55 14.33 51.38 12.96 -4.17 ... #> .. .. .. ..- attr(*, "names")= chr [1:18] "(Intercept)" "Memory6GB" "Memory8GB" "RadioYes" ... #> .. .. ..$ rank : int 10 #> .. .. ..$ fitted.values: Named num [1:18] 53.3 64.9 50.4 67.6 49.1 ... #> .. .. .. ..- attr(*, "names")= chr [1:18] "1" "2" "3" "4" ... #> .. .. ..$ assign : int [1:10] 0 1 1 2 3 3 4 4 5 5 #> .. .. ..$ qr :List of 5 #> .. .. .. ..$ qr : num [1:18, 1:10] -4.243 0.236 0.236 0.236 0.236 ... #> .. .. .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. .. .. ..$ : chr [1:18] "1" "2" "3" "4" ... #> .. .. .. .. .. ..$ : chr [1:10] "(Intercept)" "Memory6GB" "Memory8GB" "RadioYes" ... #> .. .. .. .. ..- attr(*, "assign")= int [1:10] 0 1 1 2 3 3 4 4 5 5 #> .. .. .. .. ..- attr(*, "contrasts")=List of 5 #> .. .. .. .. .. ..$ Memory: chr "contr.treatment" #> .. .. .. .. .. ..$ Radio : chr "contr.treatment" #> .. .. .. .. .. ..$ Size : chr "contr.treatment" #> .. .. .. .. .. ..$ Price : chr "contr.treatment" #> .. .. .. .. .. ..$ Shape : chr "contr.treatment" #> .. .. .. ..$ qraux: num [1:10] 1.24 1.37 1.23 1.08 1.01 ... #> .. .. .. ..$ pivot: int [1:10] 1 2 3 4 5 6 7 8 9 10 #> .. .. .. ..$ tol : num 1e-07 #> .. .. .. ..$ rank : int 10 #> .. .. .. ..- attr(*, "class")= chr "qr" #> .. .. ..$ df.residual : int 8 #> .. .. ..$ contrasts :List of 5 #> .. .. .. ..$ Memory: chr "contr.treatment" #> .. .. .. ..$ Radio : chr "contr.treatment" #> .. .. .. ..$ Size : chr "contr.treatment" #> .. .. .. ..$ Price : chr "contr.treatment" #> .. .. .. ..$ Shape : chr "contr.treatment" #> .. .. ..$ xlevels :List of 5 #> .. .. .. ..$ Memory: chr [1:3] "4GB" "6GB" "8GB" #> .. .. .. ..$ Radio : chr [1:2] "No" "Yes" #> .. .. .. ..$ Size : chr [1:3] "Large" "Medium" "Small" #> .. .. .. ..$ Price : chr [1:3] "$50" "$100" "$150" #> .. .. .. ..$ Shape : chr [1:3] "Circular" "Rectangular" "Square" #> .. .. ..$ call : language lm(formula = formula, data = cdat) #> .. .. ..$ terms :Classes 'terms', 'formula' language Rating ~ Memory + Radio + Size + Price + Shape #> .. .. .. .. ..- attr(*, "variables")= language list(Rating, Memory, Radio, Size, Price, Shape) #> .. .. .. .. ..- attr(*, "factors")= int [1:6, 1:5] 0 1 0 0 0 0 0 0 1 0 ... #> .. .. .. .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. .. .. .. ..$ : chr [1:6] "Rating" "Memory" "Radio" "Size" ... #> .. .. .. .. .. .. ..$ : chr [1:5] "Memory" "Radio" "Size" "Price" ... #> .. .. .. .. ..- attr(*, "term.labels")= chr [1:5] "Memory" "Radio" "Size" "Price" ... #> .. .. .. .. ..- attr(*, "order")= int [1:5] 1 1 1 1 1 #> .. .. .. .. ..- attr(*, "intercept")= int 1 #> .. .. .. .. ..- attr(*, "response")= int 1 #> .. .. .. .. ..- attr(*, ".Environment")=<environment: 0xe9efd60> #> .. .. .. .. ..- attr(*, "predvars")= language list(Rating, Memory, Radio, Size, Price, Shape) #> .. .. .. .. ..- attr(*, "dataClasses")= Named chr [1:6] "numeric" "factor" "factor" "factor" ... #> .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Rating" "Memory" "Radio" "Size" ... #> .. .. ..$ model :'data.frame': 18 obs. of 6 variables: #> .. .. .. ..$ Rating: int [1:18] 53 65 50 68 49 25 75 95 66 65 ... #> .. .. .. ..$ Memory: Factor w/ 3 levels "4GB","6GB","8GB": 1 2 1 3 3 2 2 3 1 2 ... #> .. .. .. ..$ Radio : Factor w/ 2 levels "No","Yes": 1 2 2 1 1 2 1 2 2 1 ... #> .. .. .. ..$ Size : Factor w/ 3 levels "Large","Medium",..: 3 2 2 1 3 1 3 1 3 2 ... #> .. .. .. ..$ Price : Factor w/ 3 levels "$50","$100","$150": 1 1 2 2 3 3 1 1 2 2 ... #> .. .. .. ..$ Shape : Factor w/ 3 levels "Circular","Rectangular",..: 3 3 3 3 3 3 1 1 1 1 ... #> .. .. .. ..- attr(*, "terms")=Classes 'terms', 'formula' language Rating ~ Memory + Radio + Size + Price + Shape #> .. .. .. .. .. ..- attr(*, "variables")= language list(Rating, Memory, Radio, Size, Price, Shape) #> .. .. .. .. .. ..- attr(*, "factors")= int [1:6, 1:5] 0 1 0 0 0 0 0 0 1 0 ... #> .. .. .. .. .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. .. .. .. .. ..$ : chr [1:6] "Rating" "Memory" "Radio" "Size" ... #> .. .. .. .. .. .. .. ..$ : chr [1:5] "Memory" "Radio" "Size" "Price" ... #> .. .. .. .. .. ..- attr(*, "term.labels")= chr [1:5] "Memory" "Radio" "Size" "Price" ... #> .. .. .. .. .. ..- attr(*, "order")= int [1:5] 1 1 1 1 1 #> .. .. .. .. .. ..- attr(*, "intercept")= int 1 #> .. .. .. .. .. ..- attr(*, "response")= int 1 #> .. .. .. .. .. ..- attr(*, ".Environment")=<environment: 0xe9efd60> #> .. .. .. .. .. ..- attr(*, "predvars")= language list(Rating, Memory, Radio, Size, Price, Shape) #> .. .. .. .. .. ..- attr(*, "dataClasses")= Named chr [1:6] "numeric" "factor" "factor" "factor" ... #> .. .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Rating" "Memory" "Radio" "Size" ... #> .. .. ..- attr(*, "class")= chr "lm" #> .. ..$ coeff:'data.frame': 10 obs. of 6 variables: #> .. .. ..$ label : chr [1:10] "(Intercept)" "Memory|6GB" "Memory|8GB" "Radio|Yes" ... #> .. .. ..$ coefficient: num [1:10] 58.11 7.67 29.67 6.11 6.33 ... #> .. .. ..$ std.error : num [1:10] 0.891 0.691 0.691 0.564 0.691 ... #> .. .. ..$ t.value : num [1:10] 65.18 11.1 42.96 10.84 9.17 ... #> .. .. ..$ p.value : num [1:10] 3.41e-12 3.87e-06 9.50e-11 4.64e-06 1.61e-05 ... #> .. .. ..$ sig_star : chr [1:10] "***" "***" "***" "***" ... #> .. ..$ tab :List of 3 #> .. .. ..$ PW :'data.frame': 15 obs. of 3 variables: #> .. .. .. ..$ Attributes: chr [1:15] "Memory" "Memory" "Memory" "Radio" ... #> .. .. .. ..$ Levels : chr [1:15] "4GB" "6GB" "8GB" "No" ... #> .. .. .. ..$ PW : num [1:15] 0 7.67 29.67 0 6.11 ... #> .. .. ..$ IW :'data.frame': 5 obs. of 2 variables: #> .. .. .. ..$ Attributes: chr [1:5] "Memory" "Radio" "Size" "Price" ... #> .. .. .. ..$ IW : num [1:5] 0.28 0.058 0.08 0.319 0.263 #> .. .. ..$ plot_ylim:'data.frame': 5 obs. of 2 variables: #> .. .. .. ..$ Min: num [1:5] 0 0 0 -34.2 -34.2 #> .. .. .. ..$ Max: num [1:5] 34.2 34.2 34.2 0 0 #> $ bylevs : chr "full" #> $ df_name : chr "mp3" #> $ vars : chr [1:5] "Memory" "Radio" "Size" "Price" ... #> $ dataset :Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 18 obs. of 6 variables: #> ..$ Rating: int [1:18] 53 65 50 68 49 25 75 95 66 65 ... #> ..$ Memory: Factor w/ 3 levels "4GB","6GB","8GB": 1 2 1 3 3 2 2 3 1 2 ... #> ..$ Radio : Factor w/ 2 levels "No","Yes": 1 2 2 1 1 2 1 2 2 1 ... #> ..$ Size : Factor w/ 3 levels "Large","Medium",..: 3 2 2 1 3 1 3 1 3 2 ... #> ..$ Price : Factor w/ 3 levels "$50","$100","$150": 1 1 2 2 3 3 1 1 2 2 ... #> ..$ Shape : Factor w/ 3 levels "Circular","Rectangular",..: 3 3 3 3 3 3 1 1 1 1 ... #> ..- attr(*, "description")= chr "## MP3 player\n\n### Description\n\nConjoint data from one respondent. Ratings reflect the evaluation of 18 alt"| __truncated__ #> $ rvar : chr "Rating" #> $ evar : chr [1:5] "Memory" "Radio" "Size" "Price" ... #> $ int : chr "" #> $ by : chr "none" #> $ reverse : logi FALSE #> $ data_filter: chr "" #> - attr(*, "class")= chr [1:2] "conjoint" "list"