File containing all data and code for replication
api_collection/script_question_collect_v2.ipynb contains the code for collecting answers to Pew's Typology Quiz. You need to enter your OpenAI API key to run this file.
api_collection/script_question_wrangling_v2.ipynb processes the answers so that it's readable in Stata.
api_collection/script_text_collect_v2.ipynb contains the code for collecting free text according to Typology's themes. You need to enter your OpenAI API key to run this file.
api_collection/script_text_analysis_v2.ipynb processes the generated free text, calculating similarity and generating the word clouds.
code/dofile_question_v2.do contains the Stata code to generate the questions' analyses.
code/dofile_text_v2.do contains the Stata code to generate the free text and image analyses.