design_pAMCE: Estimating the population AMCE using a design-based approach

View source: R/design_pAMCE.R

design_pAMCER Documentation

Estimating the population AMCE using a design-based approach

Description

design_pAMCE implements the design-based approach to estimate the pAMCE. See de la Cuesta, Egami, and Imai (2019+) for details. More examples are available at the GitHub page of factorEx.

Usage

design_pAMCE(
  formula,
  factor_name,
  data,
  pair = FALSE,
  pair_id = NULL,
  cross_int = FALSE,
  cluster_id = NULL,
  target_dist,
  target_type,
  partial_joint_name
)

Arguments

formula

Formula

factor_name

Factors for which the function estimates the pAMCEs. If not specified, the function estimates for all factors.

data

Data

pair

Whether we use a paired-choice conjoint design.

pair_id

Unique identifiers for pairs in the paired-choice conjoint design (optional).

cross_int

Include interactions across profiles. Default is FALSE.

cluster_id

Unique identifiers for computing cluster standard errors (optional).

target_dist

Target profile distributions to be used. See Examples in the GitHub page for details.

target_type

Types of target profile distributions. ‘marginal', ’partial_joint', or 'target_data'.

partial_joint_name

(when 'target_type = "partial_joint"') Names of factors representing partial joint distributions. See Examples in the GitHub page for details.

Value

design_pAMCE returns an object of pAMCE class.

  • AMCE: Estimates of the pAMCE for all factors.

  • design_weight: Weight for each observation used in the weighted difference-in-means.

  • approach: "design_based"

  • input: Input into the function.

  • ...: Values for internal use.

References

de la Cuesta, Egami, and Imai. (2019+). Improving the External Validity of Conjoint Analysis: The Essential Role of Profile Distribution. (Working Paper). Available at https://scholar.princeton.edu/sites/default/files/negami/files/conjoint_profile.pdf.

Egami and Imai. (2019). Causal Interaction in Factorial Experiments: Application to Conjoint Analysis. Journal of the American Statistical Association, Vol.114, No.526 (June), pp. 529–540. Available at https://scholar.princeton.edu/sites/default/files/negami/files/causalint.pdf.

Examples

# Small example
data("OnoBurden")
OnoBurden_data_pr_s <- OnoBurden$OnoBurden_data_pr[1:500, ]
# randomization based on marginal population design
target_dist_marginal_s <- OnoBurden$target_dist_marginal[c("gender", "age")]

# design-based estimation
out_design_mar_s <-
  design_pAMCE(formula = Y ~ gender + age,
               factor_name = "gender",
               data = OnoBurden_data_pr_s,
               pair_id = OnoBurden_data_pr_s$pair_id,
               cluster_id = OnoBurden_data_pr_s$id,
               target_dist  = target_dist_marginal_s, target_type = "marginal")
summary(out_design_mar_s)

  #  Example
  data("OnoBurden")
  OnoBurden_data_pr <- OnoBurden$OnoBurden_data_pr
  # randomization based on marginal population design
  target_dist_marginal <- OnoBurden$target_dist_marginal

  # design-based estimation
  out_design_mar <-
    design_pAMCE(formula = Y ~ gender + age + family + race + experience + party + pos_security,
                 factor_name = c("gender", "age", "experience"),
                 data = OnoBurden_data_pr,
                 pair_id = OnoBurden_data_pr$pair_id,
                 cluster_id = OnoBurden_data_pr$id,
                 target_dist  = target_dist_marginal, target_type = "marginal")
 summary(out_design_mar)


naoki-egami/factorEx documentation built on Oct. 8, 2022, 5:41 a.m.