Core workhorse for computing marginal means (MMs) or AMCEs from a conjoint design, with optional intra-respondent reliability (IRR) correction.
pj_estimate(
.data,
.structure,
.estimand,
.att_choose,
.lev_choose,
.att_notchoose,
.lev_notchoose,
.att_choose_b,
.lev_choose_b,
.att_notchoose_b,
.lev_notchoose_b,
.se_method,
.irr,
.remove_ties,
.ignore_position,
.n_sims,
.n_boot,
.weights_1,
.clusters_1,
.se_type_1,
.weights_2,
.clusters_2,
.se_type_2,
.auto_cluster = TRUE,
.seed = NULL
)A data frame with rows for the requested estimand(s) and columns:
estimand: one of "mm_uncorrected", "mm_corrected",
"amce_uncorrected", "amce_corrected".
estimate, se, conf.low, conf.high, tau.
A projoint_data object created by reshape_projoint or make_projoint_data.
Either "profile_level" or "choice_level".
Either "mm" (marginal mean) or "amce" (average marginal component effect).
Attribute for the chosen profile/feature.
Level(s) for the chosen profile/feature. Length 1 for profile_level; may be 1+ for choice_level.
Attribute for the not-chosen profile/feature (required for choice_level).
Level(s) for the not-chosen profile/feature (required for choice_level).
(AMCE only) Baseline attribute for comparison.
(AMCE only) Baseline level(s) for comparison.
(AMCE only, choice-level only) Baseline attribute for the not-chosen profile.
(AMCE only, choice-level only) Baseline level(s) for the not-chosen profile.
One of "analytical", "simulation", or "bootstrap".
NULL (default) to estimate IRR from repeated tasks; otherwise a numeric IRR value.
Logical; should ties be removed before estimation? Defaults to TRUE.
Logical; only for choice_level. If TRUE (default), ignore profile position (left/right).
Integer; required if .se_method == "simulation".
Integer; required if .se_method == "bootstrap".
(Optional) Bare (unquoted) column with weights for IRR estimation; passed to lm_robust.
(Optional) Bare (unquoted) column with clusters for IRR estimation; passed to lm_robust.
SE type for IRR estimation; passed to lm_robust. If NULL, estimatr defaults are used (HC2 when unclustered; CR2 when clustered).
(Optional) Bare (unquoted) column with weights for MM/AMCE estimation; passed to lm_robust.
(Optional) Bare (unquoted) column with clusters for MM/AMCE estimation; passed to lm_robust.
SE type for MM/AMCE estimation; passed to lm_robust. If NULL, estimatr defaults are used (HC2 when unclustered; CR2 when clustered).
Logical; if TRUE (default), auto-cluster on id when present and no .clusters_* are supplied; auto-clustering only occurs when the corresponding .se_type_* is NULL. See projoint.
Optional integer. If supplied, sets a temporary RNG seed for reproducible simulation/bootstrap inside this call and restores the previous RNG state on exit.
IRR is clipped to [0.5, 1) (with a tiny epsilon) to avoid boundary issues.
For choice-level MMs, ties must be removed (.remove_ties = TRUE).
When .seed is supplied, the previous RNG state is restored on exit.
lm_robust, projoint,
projoint_level, projoint_diff