Core worker used by projoint
to compute marginal means (MMs)
or average marginal component effects (AMCEs) under either the profile- or
choice-level structure. Handles IRR usage (estimated or fixed) and the
requested standard-error method.
Usage
projoint_level(
.data,
.qoi,
.structure,
.estimand,
.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
)
Arguments
- .data
A
projoint_data
object.- .qoi
Optional
projoint_qoi
; ifNULL
, estimates all MMs/AMCEs implied by the design. When supplied, overrides.structure
and.estimand
.- .structure
Either
"profile_level"
or"choice_level"
.- .estimand
Either
"mm"
(marginal mean) or"amce"
(average marginal component effect).- .se_method
One of
"analytical"
,"simulation"
, or"bootstrap"
.- .irr
NULL
to estimate IRR from repeated tasks; numeric to fix IRR.- .remove_ties
Logical; whether to drop tied responses (default
TRUE
).- .ignore_position
Logical; choice-level only. Ignore left/right position? Default
TRUE
.- .n_sims
Integer; required when
.se_method = "simulation"
.- .n_boot
Integer; required when
.se_method = "bootstrap"
.- .weights_1, .clusters_1, .se_type_1
Arguments passed to
lm_robust
for IRR estimation. If.se_type_1
isNULL
, estimatr defaults are used.- .weights_2, .clusters_2, .se_type_2
Arguments passed to
lm_robust
for MM/AMCE estimation. If.se_type_2
isNULL
, estimatr defaults are used.- .auto_cluster
Logical; if
TRUE
(default) and anid
column is present while no clusters are provided, cluster automatically. Only applied when the corresponding.se_type_*
isNULL
.- .seed
Optional integer; if supplied, sets a temporary RNG seed for simulation/bootstrap and restores prior state on exit.
Value
A projoint_results
object containing:
estimates
: tibble of estimates (point estimate, SE, CI) with identifier columns (e.g.,att_level_*
).estimand
:"mm"
or"amce"
.structure
:"profile_level"
or"choice_level"
.se_method
: SE computation method used.irr
: character noting IRR usage (e.g.,"Estimated"
or"Assumed (<value> )"
).tau
: numeric \(\tau\) used to correct measurement error.remove_ties
,ignore_position
: flags echoed from inputs.se_type_used
,cluster_by
: details propagated from fitting calls (if available).labels
,data
: design labels and the analysis data passed through for downstream methods.