Closed emmaebowe closed 1 year ago
Hi @emmaebowe, amazing work! Just a few notes:
Happy to talk about these points in more detail or answer any other questions you may have!
A population deviation of over 13% in the enacted map (the red line in the population deviation histogram) seems to high. It seems like we are correctly loading 2000 Census data, so maybe cd_2010 is not actually the lines drawn for the 2012-2020 cycle? I added some comments on where the mixup may be happening.
Hey Emma, I'll do a full review later today, but re the discussion today, one way to "check" performance, you can look at this plot after you run it:
redist.plot.distr_qtys(plans, vap_black/total_vap,
color_thresh = NULL,
color = ifelse(subset_sampled(plans)$ndv > subset_sampled(plans)$nrv, "#3D77BB", "#B25D4C"),
size = 0.5, alpha = 0.5) +
scale_y_continuous("Percent Black by VAP") +
labs(title = "Approximate Performance") +
scale_color_manual(values = c(cd_2010 = "black")) +
theme_bw()
(Change out vap_black/total_vap
for whatever group you are checking)
@christopherkenny
@emmaebowe, it looks like this one still has the extra files.
In North Carolina, districts must:
We enforce a maximum population deviation of 0.5%. We add a county constraint. We add a VRA constraint targeting two majority-minority districts to ensure that the simulated plans are similar to the ratified ones on this metric.
Data for North Carolina comes from the ALARM Project's 2020 Redistricting Data Files.
No manual pre-processing decisions were necessary.
We sample 24,000 districting plans for North Carolina, and thin to 5,000 final plans. No special techniques were needed to produce the sample.
> summary(plans)
✔ Saving <redist_plans> object ... done
SMC: 5,000 sampled plans of 13 districts on 2,692 units
`adapt_k_thresh`=0.985 • `seq_alpha`=0.5
`est_label_mult`=1 • `pop_temper`=0.05
ℹ Preparing MD shapefile
Plan diversity 80% range: 0.68 to 0.88
ℹ Preparing MD shapefile
R-hat values for summary statistics:
pop_overlap total_vap plan_dev comp_edge comp_polsby pop_white
1.020806 1.016922 1.004642 1.016755 1.002336 1.014174
pop_black pop_hisp pop_aian pop_asian pop_nhpi pop_other
1.004754 1.001528 1.002835 1.009669 1.027798 1.025220
pop_two vap_white vap_black vap_hisp vap_aian vap_asian
1.010126 1.011099 1.003383 1.004165 1.006258 1.008749
vap_nhpi vap_other vap_two pre_16_rep_tru pre_16_dem_cli pre_20_rep_tru
1.045441 1.001032 1.000346 1.012643 1.022844 1.006889
pre_20_dem_bid uss_16_rep_bur uss_16_dem_ros uss_20_rep_til uss_20_dem_cun gov_16_rep_mcc
1.018991 1.007392 1.019683 1.004446 1.015104 1.009775
gov_16_dem_coo gov_20_rep_for gov_20_dem_coo atg_16_rep_new atg_16_dem_ste atg_20_rep_one
1.018468 1.010013 1.018432 1.007721 1.019768 1.007299
atg_20_dem_ste sos_16_rep_lap sos_16_dem_mar sos_20_rep_syk sos_20_dem_mar adv_16
1.018934 1.007604 1.017715 1.004065 1.018679 1.018821
adv_20 arv_16 arv_20 county_splits muni_splits ndv
1.018735 1.008668 1.007069 1.007580 1.017071 1.018352
nrv ndshare e_dvs pr_dem e_dem pbias
1.008054 1.024337 1.024166 1.040864 1.004206 1.008595
egap
1.004343
Sampling diagnostics for SMC run 1 of 2 (12,000 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 8,255 (68.8%) 16.4% 0.45 7,586 (100%) 8
Split 2 8,426 (70.2%) 19.5% 0.67 6,817 ( 90%) 6
Split 3 8,505 (70.9%) 26.2% 0.71 6,851 ( 90%) 4
Split 4 8,464 (70.5%) 30.7% 0.75 6,821 ( 90%) 3
Split 5 8,432 (70.3%) 17.9% 0.77 6,750 ( 89%) 5
Split 6 8,243 (68.7%) 16.4% 0.79 6,776 ( 89%) 5
Split 7 8,453 (70.4%) 18.3% 0.79 6,798 ( 90%) 4
Split 8 8,441 (70.3%) 21.2% 0.78 6,845 ( 90%) 3
Split 9 8,489 (70.7%) 18.7% 0.79 6,792 ( 90%) 3
Split 10 8,277 (69.0%) 21.9% 0.81 6,580 ( 87%) 2
Split 11 8,780 (73.2%) 16.5% 0.79 6,357 ( 84%) 2
Split 12 7,540 (62.8%) 4.3% 0.81 5,759 ( 76%) 3
Resample 1,635 (13.6%) NA% 1.39 4,491 ( 59%) NA
Sampling diagnostics for SMC run 2 of 2 (12,000 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 8,234 (68.6%) 16.4% 0.45 7,593 (100%) 8
Split 2 8,535 (71.1%) 19.9% 0.67 6,785 ( 89%) 6
Split 3 8,475 (70.6%) 15.5% 0.70 6,764 ( 89%) 7
Split 4 8,476 (70.6%) 19.5% 0.76 6,805 ( 90%) 5
Split 5 8,422 (70.2%) 18.1% 0.77 6,828 ( 90%) 5
Split 6 8,313 (69.3%) 20.5% 0.77 6,829 ( 90%) 4
Split 7 8,402 (70.0%) 18.5% 0.78 6,797 ( 90%) 4
Split 8 8,363 (69.7%) 16.2% 0.79 6,724 ( 89%) 4
Split 9 8,209 (68.4%) 18.5% 0.79 6,759 ( 89%) 3
Split 10 8,220 (68.5%) 15.2% 0.79 6,575 ( 87%) 3
Split 11 8,499 (70.8%) 7.2% 0.80 6,309 ( 83%) 5
Split 12 7,525 (62.7%) 4.2% 0.79 5,723 ( 75%) 3
Resample 2,393 (19.9%) NA% 1.40 4,749 ( 63%) NA
• Watch out for low effective samples, very low acceptance rates (less than 1%), large std.
devs. of the log weights (more than 3 or so), and low numbers of unique plans. R-hat values
for summary statistics should be between 1 and 1.05.
ℹ Preparing MD shapefile
>
Redistricting requirements
In North Carolina, districts must:
Interpretation of requirements
We enforce a maximum population deviation of 0.5%. We add a county constraint. We add a VRA constraint targeting two majority-minority districts to ensure that the simulated plans are similar to the ratified ones on this metric.
Data Sources
Data for North Carolina comes from https://redistricting.lls.edu/state/north-carolina/
Pre-processing Notes
No manual pre-processing decisions were necessary.
Validation
Checklist
TODO
lines from the template code have been removedenforce_style()
to format my coderedist_map
andredist_plans
objects, and summary statistics) have been edited@CoryMcCartan @christopherkenny