Skip to contents

This function analyzes a conjoint data set and produces corrected estimates of either marginal means (MMs) or average marginal component effects (AMCEs), ready for plotting. It corrects for intra-respondent reliability (IRR) bias and accounts for repeated tasks if available.

Usage

projoint(
  .data,
  .qoi = NULL,
  .by_var = NULL,
  .structure = "choice_level",
  .estimand = "mm",
  .se_method = "analytical",
  .irr = NULL,
  .remove_ties = TRUE,
  .ignore_position = NULL,
  .n_sims = NULL,
  .n_boot = NULL,
  .weights_1 = NULL,
  .clusters_1 = NULL,
  .se_type_1 = "classical",
  .weights_2 = NULL,
  .clusters_2 = NULL,
  .se_type_2 = "classical"
)

Arguments

.data

A projoint_data object created by reshape_projoint() or make_projoint_data().

.qoi

Optional. A projoint_qoi object if targeting custom quantities of interest.

.by_var

Character. Optional. A dichotomous variable for subgroup analysis (e.g., Republican vs Democrat). Only available for **profile-level** analysis. Ignored for choice-level analysis.

.structure

Character. Either "profile_level" (default) or "choice_level". If .qoi is supplied, the structure specified there overrides this.

.estimand

Character. Either "mm" (marginal mean) or "amce" (average marginal component effect). If .qoi is supplied, the estimand specified there overrides this.

.se_method

Character. Standard error method: "analytical" (default), "simulation", or "bootstrap".

.irr

Numeric or NULL (default). If NULL, IRR is estimated from repeated tasks; otherwise, user-supplied IRR.

.remove_ties

Logical. Should ties in choice data be removed before estimation? Defaults to TRUE.

.ignore_position

Logical. Only for choice-level analysis. Should the position of profiles (left/right) be ignored? Default is TRUE.

.n_sims

Integer. Required if .se_method = "simulation". Number of simulation draws.

.n_boot

Integer. Required if .se_method = "bootstrap". Number of bootstrap samples.

.weights_1,

.clusters_1, .se_type_1 Arguments passed to lm_robust when estimating IRR.

.clusters_1

Cluster ID variable for IRR estimation. Passed to lm_robust(). Default is NULL.

.se_type_1

Standard error type for IRR estimation. Passed to lm_robust(). Default is "classical".

.weights_2,

.clusters_2, .se_type_2 Arguments passed to lm_robust when estimating MMs or AMCEs.

.clusters_2

Cluster ID variable for MM/AMCE estimation. Passed to lm_robust(). Default is NULL.

.se_type_2

Standard error type for MM/AMCE estimation. Passed to lm_robust(). Default is "classical".

Value

A projoint_results object containing estimated quantities, ready for plotting or further analysis.

Details

Most users simply provide a projoint_data object. Advanced users can also specify quantities of interest using projoint_qoi.