View source: R/set_qoi.R View source: R/set_qoi.R
| set_qoi | R Documentation |
Constructs a quantities-of-interest (QoI) specification for projoint. Use this to request specific estimands—marginal means (MMs) or average marginal component effects (AMCEs)—at either the choice- or profile-level, and to declare which attribute levels are compared (including baselines).
set_qoi(
.structure = "choice_level",
.estimand = "mm",
.att_choose,
.lev_choose,
.att_notchoose = NULL,
.lev_notchoose = NULL,
.att_choose_b = NULL,
.lev_choose_b = NULL,
.att_notchoose_b = NULL,
.lev_notchoose_b = NULL
)
.structure |
Either |
.estimand |
Either |
.att_choose |
Character scalar: the attribute (column) for the level(s) that are chosen. |
.lev_choose |
Character vector: the level id(s) for the chosen
side. Length 1 for profile-level, |
.att_notchoose |
Character scalar: the attribute (column) for the level(s)
that are not chosen. Only used for |
.lev_notchoose |
Character vector: the level id(s) for the not chosen
side. Length 1 for profile-level, |
.att_choose_b |
Character scalar: baseline attribute for the chosen side when computing AMCEs. |
.lev_choose_b |
Character vector: baseline level id(s) for the
chosen side when computing AMCEs. Length 1 for profile-level, |
.att_notchoose_b |
Character scalar: baseline attribute for the not-chosen side (choice-level only) when computing AMCEs. |
.lev_notchoose_b |
Character vector: baseline level id(s) for the not-chosen side (choice-level only) when computing AMCEs. |
A projoint_qoi object (list-like) containing fields such as:
structure, estimand, attribute_of_interest,
levels_of_interest, and their baseline counterparts. This object
can be supplied to downstream estimation helpers that accept a QoI spec.
# Specify a simple choice-level MM comparison for att1 levels:
q_mm <- set_qoi(
.structure = "choice_level",
.estimand = "mm",
.att_choose = "att1",
.lev_choose = c("att1:lev2"),
.att_notchoose = "att1",
.lev_notchoose = c("att1:lev1")
)
str(q_mm)
# Example AMCE with explicit baselines (profile-level):
q_amce <- set_qoi(
.structure = "profile_level",
.estimand = "amce",
.att_choose = "att2",
.lev_choose = "att2:lev3",
.att_choose_b = "att2",
.lev_choose_b = "att2:lev1"
)
str(q_amce)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.