sconjoint: Structural Deep Learning for Conjoint Experiments

Welcome

sconjoint is an R package implementing the structural deep learning estimator for forced-choice conjoint experiments developed by Acharya, Hainmueller, and Xu (2026) (paper). The estimator embeds a deep neural network inside a random-utility logit so that each respondent’s preference vector \(\hat{\boldsymbol\beta}(\mathbf Z_i) \in \mathbb{R}^p\) varies smoothly and flexibly with her observed covariates \(\mathbf Z\). Double / debiased machine learning [DML; Chernozhukov et al. (2018)] inference provides honest respondent-clustered standard errors on all population-level quantities.

The key advance over the standard AMCE framework (Hainmueller, Hopkins, and Yamamoto 2014) is that \(\hat{\boldsymbol\beta}(\mathbf Z_i)\) gives the joint distribution of preferences across attributes for each respondent, enabling structural quantities — marginal rates of substitution, counterfactual choice probabilities, preference polarization, willingness to pay — that require the full preference vector rather than one-attribute-at-a-time marginal effects.

This book is the primary user documentation for the package. It walks from installation through four complete worked examples, a simulation sanity check, a reference catalog of the structural estimands, and visualization options.

library(sconjoint)
data(package = "sconjoint")$results[, c("Item", "Title")]
     Item     
[1,] "br2017" 
[2,] "bs2013" 
[3,] "gs2020" 
[4,] "simdata"
[5,] "sw2022" 
     Title                                                               
[1,] "Ballard-Rosa, Martin & Scheve (2017) tax-plan conjoint"            
[2,] "Bechtel-Scheve (2013) climate-treaty conjoint"                     
[3,] "Graham-Svolik (2020) candidate-choice conjoint on democratic norms"
[4,] "Simulated conjoint with known ground truth"                        
[5,] "Saha-Weeks (2022) candidate-choice conjoint"                       

Bundled datasets

The package ships four conjoint datasets from published replication materials, covering democratic norms, tax preferences, candidate choice, and climate treaties.

NoteThese are the paper’s analysis datasets

The bundled gs2020, br2017, and sw2022 datasets are the full analysis frames used in Acharya, Hainmueller, and Xu (2026), carrying the paper’s complete respondent-moderator set \(\mathbf Z\) (22, 23, and 19 covariates). The worked examples fit the paper’s production configuration — K = 10 cross-fitting folds, the default 1,000 Adam epochs, and the per-application Stage-2 prior — so the structural quantities they report reproduce the manuscript’s empirical results. These fits are heavier than a quick demo, so each example chunk is cached and the book reuses the saved fit on re-render. (bs2013 is a lightweight teaching example, not one of the paper’s applications.)

gs2020Graham and Svolik (2020): democratic norms

1,605 respondents \(\times\) $$13 matchups \(\times\) 2 profiles = 41,314 rows. Thirty attribute contrasts (the diff_ columns: party, two policy dimensions, the 16-level democracy code, candidate sex, race, and profession) and the paper’s 22 respondent moderators (\(\mathbf Z\)): ideology, party, Trump approval, demographics, authoritarianism, political knowledge, issue ideal points, and six direct democracy-attitude items. The paper’s main specification holds out the six direct items and fits on the remaining 16. Raw ideo7, pid7, and the survey weight are carried as convenience columns for subgroup and weighting analyses.

br2017Ballard-Rosa, Martin, and Scheve (2017): tax preferences

2,000 respondents \(\times\) 8 tasks \(\times\) 2 profiles = 32,000 rows. Seven numeric attributes (six bracket rates plus a revenue-impact indicator) and the paper’s 23 respondent moderators (\(\mathbf Z\)): demographics, partisanship, ideology, and economic attitudes and beliefs. Bracket rates are rebuilt from the source file’s coded variables and value labels; the distributed file’s derived rate column stores the 45% level of the $175–375k bracket as 5, which affected bundled copies before 0.2.0.9004 (see ?br2017). Raw seven-point resp_pid7 is carried as a convenience column for the by-party analyses.

sw2022Saha and Weeks (2022): candidate choice

1,191 respondents \(\times\) 3 tasks \(\times\) 2 profiles = 7,146 rows. Thirteen candidate-attribute dummies (gender, prior run, talent, agenda, children) and the paper’s full set of 19 respondent moderators (\(\mathbf Z\)): gender, age, income, education, party, region, employment status, ideology, vote choice, and a gender-attitudes scale. A convenience factor resp_party (Democrat / Independent / Republican) is carried for subgroup labelling and is not part of \(\mathbf Z\).

bs2013Bechtel and Scheve (2013): climate treaties

2,500 respondents \(\times\) 4 tasks \(\times\) 2 profiles = 20,000 rows. Five categorical treaty attributes (burden distribution, emissions target, monitoring body, participation, and sanctions) plus a numeric monthly cost_usd attribute, and three respondent moderators (resp_female, resp_age, and 0–10 resp_ideo). The numeric cost supports dollar-scale willingness-to-pay analysis. This is a lightweight teaching example, not one of the paper’s applications.

Organization

The user guide is structured into the following chapters:

Authors

How to Cite

Acharya, Avidit, Jens Hainmueller, and Yiqing Xu. 2026. sconjoint: Structural Deep-Learning Estimation for Conjoint Experiments — User Manual (v0.2.0). https://github.com/xuyiqing/sconjoint

@manual{sconjoint2026,
  title = {sconjoint: Structural Deep-Learning Estimation for Conjoint Experiments --- User Manual},
  author = {Acharya, Avidit and Hainmueller, Jens and Xu, Yiqing},
  year = {2026},
  note = {R package version 0.2.0},
  url = {https://github.com/xuyiqing/sconjoint}
}

Report Bugs

Please report any bugs by submitting an issue on GitHub or emailing Yiqing Xu (yiqingxu [at] stanford.edu). Please include a minimally reproducible example and your sessionInfo() output.

sconjoint: Lifecycle: experimental License: MIT