library(projoint) library(dplyr) library(ggplot2) library(patchwork)
In conjoint analysis, default MMs and AMCEs can be biased due to measurement error from intra-respondent variability.
projoint corrects for this bias automatically.
The following instructions apply to choice-level data. What if you have profile-level data?ⓘ Our FAQ Page has instructions to estimate and visualize profile-level QOIs.
Outcome naming & order (important)
- List
.outcomesin the order questions were asked.- If you have a repeated task, its outcome must be the last element.
- For base tasks (all but last), the function reads the digits in each name as the task id (e.g.,
"choice4","Q4","task04"→ task 4).- The repeated base task is inferred from the first base outcome’s digits. The repeated outcome itself need not contain digits—only its position (last) matters.
- Outcome strings should end with your choice labels; by default we parse the last character and expect
"A"/"B". If your survey uses"1"/"2"(or other endings), set.choice_labelsaccordingly.
Examples
# Standard order; repeated = task 1 data("exampleData1") outcomes <- c(paste0("choice", 1:8), "choice1_repeated_flipped") out1 <- reshape_projoint(exampleData1, outcomes)
att1, level1)?Before estimating quantities, it’s important to understand how attribute and level IDs work inside projoint.
Check attribute-level mappings:
out1$labels
You can also save these labels for easier editing:
save_labels(out1, "labels.csv")
Choice-Level MMs (Specific Level)
Suppose you want to estimate, within a given profile pair, the probability of choosing a profile that includes "40% of pre-tax income" (level3) for Housing Cost (att1) rather than one that includes "15% of pre-tax income" (level1) for the same attribute, averaging over all combinations of the other attributes and across respondents; then use the following code:
qoi <- set_qoi( .structure = "choice_level", .att_choose = "att1", .lev_choose = "level3", .att_notchoose = "att1", .lev_notchoose = "level1" ) mm2 <- projoint(out1, qoi) print(mm2) summary(mm2)
Choice-Level AMCEs (Specific Level)
Suppose you want to quantify how the choice probability changes between the following profile pairs:
level3) for Housing Cost (att1) versus one that includes "15% of pre-tax income" (level1) for Housing Cost (att1); andlevel2) for Housing Cost (att1) versus one that includes "15% of pre-tax income" (level1) for Housing Cost (att1); averaging over all combinations of the other attributes and across respondents. Then write the following code:
qoi <- set_qoi( .structure = "choice_level", .estimand = "amce", .att_choose = "att1", .lev_choose = "level3", .att_notchoose = "att1", .lev_notchoose = "level1", .att_choose_b = "att1", .lev_choose_b = "level2", .att_notchoose_b = "att1", .lev_notchoose_b = "level1" ) amce2 <- projoint(out1, qoi) print(amce2) summary(amce2)
If your design does not include a repeated task, you can predict IRR using predict_tau(), based on observed respondent behavior.
Predict IRR Using
predict_tau()
data(out1_arranged) predicted_irr <- predict_tau(out1_arranged) print(predicted_irr) summary(predicted_irr) plot(predicted_irr)
# Global default settings for all figures knitr::opts_chunk$set( fig.width = 6, fig.height = 3, fig.align = "center", dpi = 300 # Optional: high-resolution plots ) # Helper functions for special figure sizes narrow_fig <- function() list(fig.width = 5, fig.height = 4) wide_fig <- function() list(fig.width = 8, fig.height = 5) tall_fig <- function() list(fig.width = 6, fig.height = 7)
library(projoint) library(ggplot2) data(out1_arranged, package = "projoint")
The projoint package provides ready-to-publish plotting tools for conjoint analysis results.
Note: The current version of projoint supports plotting choice-level MMs only.
Support for choice-level AMCEs will be available in future updates!
Estimate
qoi_mm <- set_qoi( .structure = "choice_level", # default .att_choose = "att1", .lev_choose = "level1", .att_notchoose = "att1", .lev_notchoose = "level3" )
choice_mm <- projoint( .data = out1_arranged, .qoi = qoi_mm, .ignore_position = TRUE )
Visualize (Levels)
plot(choice_mm)
Visualize (Differences)
plot(choice_mm, .type = "pointrange")
🏠 Home: Home
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.