Using Machine Learning to Test Causal Hypotheses in Conjoint Analysis

Related tags

Deep Learning CRT
Overview

Readme File for "Using Machine Learning to Test Causal Hypotheses in Conjoint Analysis" by Ham, Imai, and Janson. (2022)

All scripts were written and edited by Dae Woong Ham on 01/27/2022

Code Overview

Plotting previous empirical results (Fig 1, Fig 2)

  • "Section2_AMCE_plots/immigration_Fig1.R" produces Figure 1 AMCE plots based on original AMCE estimates
  • "Section2_AMCE_plots/gender_Fig2.R" produces Figure 2 AMCE plots based on original AMCE estimates

All simulation plots (Fig 3, 4, 5, 6, 7)

  • All simulations are plotted through "Simulations/all_simulation_plots.R" file
  • All simulation scripts are executed through "source/left_fig_simulation.sh" or "source/right_fig_simulation.sh"
  • "Simulations/Section4/Figure3_leftplot.R"/"Simulations/Section4/Figure3_rightplot.R" produces results of Fig 3 # 50 and 33 hours of computing time respectively
  • "Simulations/Appendix/Figure4_and_6_leftplot.R"/"Simulations/Section4/Figure4_and_6_rightplot.R" produces results of Fig 4 and 6 # 50 and 33 hours of computing time respectively
  • "Simulations/Appendix/Figure5_leftplot.R"/"Simulations/Section4/Figure5_rightplot.R" produces results of Fig 5 # 50 and 33 hours of computing time respectively
  • "Simulations/Appendix/Figure7.R" produces results of Fig 7 # less than 5 minutes of computing time on FAS computing cluster

Obtaining new p-values (Section 5 and Table 1)

  • All p-values in Section 5 are summarized and obtained in "Section5_ApplicationResults/pval_analysis.R"
  • "Section5_ApplicationResults/Immigration/main_analysis/obs_test_stat.R"/"Section5_ApplicationResults/Immigration/main_analysis/resampled_test_stats.R" produces observed and resampled test statistics to produce p-value in Table 1 row 1 column 1. # 30 minutes of total computing time
  • "Section5_ApplicationResults/Immigration/main_analysis/AMCE_pval.do" produces AMCE p-value in Table 1 row 1 column 2. #less than 5 seconds of total computing time
  • "Section5_ApplicationResults/Immigration/main_analysis/profile_order_effect.R"/"Section5_ApplicationResults/Immigration/main_analysis/profile_order_effect/resampled_test_stats.R" produces observed and resampled test statistics to produce p-value in Table 1 row 1 column 3. # 10 minutes of total computing time
  • "Section5_ApplicationResults/Immigration/main_analysis/carryover_effect_obs_test_stat.R"/"Section5_ApplicationResults/Immigration/main_analysis/carryover_effect_resampled_test_stats.R" produces observed and resampled test statistics to produce p-value in Table 1 row 1 column 4. # 30 minutes of total computing time
  • "Section5_ApplicationResults/Immigration/main_analysis/fatigue_effect_obs_test_stat.R"/"Section5_ApplicationResults/Immigration/main_analysis/fatigue_effect_resampled_test_stats.R" produces observed and resampled test statistics to produce p-value in Table 1 row 1 column 5. # 24 minutes of computing time
  • To obtain p-value for second row repeat above but for "Section5_ApplicationResults/Gender/..." # Approximate computation time is listed in the individual files
  • Each application also contains "../lasso_obs_test_stat.R"/"../lasso_resampled_test_stats.R" to produce supplementary main effect analysis in Section 5
  • "Section5_ApplicationResults/Immigration/with_ethnocentrism/" contains files to produce p-value when including ethnocentrism in Section 5.1
  • "Section5_ApplicationResults/gender/supplementary_analysis/" contains files to produce p-value when performing robustness analysis using second most significant interaction in Appendix
  • "Section5_ApplicationResults/gender/main_analysis/presidential_lasso_explore.R" contains script to find which interaction is strongest in Presidential dataset

Other folders

  • "data" folder contains all relevant datasets in both Immigration and gender conjoint examples and all the saved results of p-values in simulations and test statistics for Section 5
  • "Figures" folder contains all figures
  • "source" folder contains all helper and main functions to run above scripts (including data cleaning, obtaining test statistics, generating simulation datasets). In particular "source/hiernet_source.R" contains the main function to compute all HierNet test statistics in the paper.

Environment

  • R version 4.1.0
  • 200 cores for all scripts that required parallel computing
  • All parallel computations in this paper were run on the FASRC Cannon cluster supported by the FAS Division of Science Research Computing Group at Harvard University
You might also like...
[ICCV 2021] Released code for Causal Attention for Unbiased Visual Recognition

CaaM This repo contains the codes of training our CaaM on NICO/ImageNet9 dataset. Due to my recent limited bandwidth, this codebase is still messy, wh

Causal estimators for use with WhyNot

WhyNot Estimators A collection of causal inference estimators implemented in Python and R to pair with the Python causal inference library whynot. For

a delightful machine learning tool that allows you to train, test and use models without writing code
a delightful machine learning tool that allows you to train, test and use models without writing code

igel A delightful machine learning tool that allows you to train/fit, test and use models without writing code Note I'm also working on a GUI desktop

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.

Master status: Development status: Package information: TPOT stands for Tree-based Pipeline Optimization Tool. Consider TPOT your Data Science Assista

Scripts of Machine Learning Algorithms from Scratch. Implementations of machine learning models and algorithms using nothing but NumPy with a focus on accessibility. Aims to cover everything from basic to advance.
Scripts of Machine Learning Algorithms from Scratch. Implementations of machine learning models and algorithms using nothing but NumPy with a focus on accessibility. Aims to cover everything from basic to advance.

Algo-ScriptML Python implementations of some of the fundamental Machine Learning models and algorithms from scratch. The goal of this project is not t

Machine Learning From Scratch. Bare bones NumPy implementations of machine learning models and algorithms with a focus on accessibility. Aims to cover everything from linear regression to deep learning.
Machine Learning From Scratch. Bare bones NumPy implementations of machine learning models and algorithms with a focus on accessibility. Aims to cover everything from linear regression to deep learning.

Machine Learning From Scratch About Python implementations of some of the fundamental Machine Learning models and algorithms from scratch. The purpose

Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.
Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.

This is the Vowpal Wabbit fast online learning code. Why Vowpal Wabbit? Vowpal Wabbit is a machine learning system which pushes the frontier of machin

This is a Machine Learning Based Hand Detector Project, It Uses Machine Learning Models and Modules Like Mediapipe, Developed By Google!

Machine Learning Hand Detector This is a Machine Learning Based Hand Detector Project, It Uses Machine Learning Models and Modules Like Mediapipe, Dev

Owner
null
This is our ARTS test set, an enriched test set to probe Aspect Robustness of ABSA.

This is the repository for our 2020 paper "Tasty Burgers, Soggy Fries: Probing Aspect Robustness in Aspect-Based Sentiment Analysis". Data We provide

null 35 Nov 16, 2022
JudeasRx - graphical app for doing personalized causal medicine using the methods invented by Judea Pearl et al.

JudeasRX Instructions Read the references given in the Theory and Notation section below Fire up the Jupyter Notebook judeas-rx.ipynb The notebook dra

Robert R. Tucci 19 Nov 7, 2022
Python Library for learning (Structure and Parameter) and inference (Statistical and Causal) in Bayesian Networks.

pgmpy pgmpy is a python library for working with Probabilistic Graphical Models. Documentation and list of algorithms supported is at our official sit

pgmpy 2.2k Jan 3, 2023
Deep Learning Models for Causal Inference

Extensive tutorials for learning how to build deep learning models for causal inference using selection on observables in Tensorflow 2.

Bernard  J Koch 151 Dec 31, 2022
Multi-task Learning of Order-Consistent Causal Graphs (NeuRIPs 2021)

Multi-task Learning of Order-Consistent Causal Graphs (NeuRIPs 2021) Authors: Xinshi Chen, Haoran Sun, Caleb Ellington, Eric Xing, Le Song Link to pap

Xinshi Chen 2 Dec 20, 2021
Code for NeurIPS 2021 paper: Invariant Causal Imitation Learning for Generalizable Policies

Invariant Causal Imitation Learning for Generalizable Policies Ioana Bica, Daniel Jarrett, Mihaela van der Schaar Neural Information Processing System

Ioana Bica 17 Dec 1, 2022
Code for Quantifying Ignorance in Individual-Level Causal-Effect Estimates under Hidden Confounding

?? quince Code for Quantifying Ignorance in Individual-Level Causal-Effect Estimates under Hidden Confounding ?? Installation $ git clone [email protected]

Andrew Jesson 19 Jun 23, 2022
CausalNLP is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable.

CausalNLP CausalNLP is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable. Install pip install -U

Arun S. Maiya 95 Jan 3, 2023
CausaLM: Causal Model Explanation Through Counterfactual Language Models

CausaLM: Causal Model Explanation Through Counterfactual Language Models Authors: Amir Feder, Nadav Oved, Uri Shalit, Roi Reichart Abstract: Understan

Amir Feder 39 Jul 10, 2022
Code for "Causal autoregressive flows" - AISTATS, 2021

Code for "Causal Autoregressive Flow" This repository contains code to run and reproduce experiments presented in Causal Autoregressive Flows, present

Ricardo Pio Monti 35 Dec 16, 2022