These are the files used for the analysis of the paper "Sociodemographic characeristics and covid-19 testing rates: spatio-temporal patterns and impact of test accessibility on Sweden"
(Almost) the entire analysis can be run using the "O_Run.do"-file. Even if the user wants to run one specific file, there are global options in the "O_Run.do"-file that might need to be set. One for determining the vaccination populatation (all inhabitants? all older than 15?), and one for determining the model to be run in the "3 Analys.do"-file. By default, "O Run.do" runs all of the models.
The results are stored in Word documents (one document for each model). This is done by Statas "putdocx"-function.
"R_plots.R" generates the correlation plots (from files created in "DescriptiveStatistics.do"). It needs to be run separately. "CNI_postal_codes.xlsx" contains info about CNI for each postal code.
"Preprocessing.do", "PCR_tests.do", "Hospitalizations.do", "CNI.do", "1 Cleaning 20211130.do", "Agegroup Populations.do" and "2 Vaccine.do" preprocesses and merges datasets for analysis. More detailed information can be found in the header of each code. "DescriptiveStatistics_alt.do" creates most of the graphs and descriptive tables. "3 Analys.do" runs the main models, generates the marginal effects and TRR plots. "Difference_in_differences.do" runs the difference-in-difference analysis. "County_vs_City_patterns.do" and "ReviewerComments_stratified_analysis.do" conducts some tests for the Reviewer response. "Restructuring_files_for_Yorgo.do" exports rawdata for making better graphs in R.
The remaining files are run from within the other files (see "0.Run.do" for more details).