Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions facebook/delphiFacebook/R/aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ summarize_indicators_day <- function(day_df, indicators, target_day, geo_level,

sample_size <- sum(ind_df$weight_in_location)

## TODO: See issue #764
new_row <- compute_fn(
response = ind_df[[metric]],
weight = if (indicators$skip_mixing[row]) { mixing$normalized_preweights } else { mixing$weights },
weight = mixing$weights,
sample_size = sample_size)

dfs_out[[indicator]][["val"]][ii] <- new_row$val
Expand Down
3 changes: 0 additions & 3 deletions facebook/delphiFacebook/R/binary.R
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,6 @@ get_binary_indicators <- function() {

)


ind$skip_mixing <- TRUE

return(ind)
}

Expand Down
3 changes: 1 addition & 2 deletions facebook/delphiFacebook/R/contingency_aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,9 @@ summarize_aggregations_group <- function(group_df, aggregations, target_group, g
sample_size <- sum(agg_df$weight_in_location)
total_represented <- sum(agg_df[[var_weight]] * agg_df$weight_in_location)

## TODO: See issue #764
new_row <- compute_fn(
response = agg_df[[metric]],
weight = if (aggregations$skip_mixing[row]) { mixing$normalized_preweights } else { mixing$weights },
weight = mixing$weights,
sample_size = sample_size,
total_represented = total_represented)

Expand Down
3 changes: 1 addition & 2 deletions facebook/delphiFacebook/R/contingency_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ verify_aggs <- function(aggregations) {
MARGIN=1, FUN=paste, collapse="_")

aggregations$var_weight <- "weight"
aggregations$skip_mixing <- FALSE

expected_names <- c("name", "var_weight", "metric", "group_by", "skip_mixing",
expected_names <- c("name", "var_weight", "metric", "group_by",
"compute_fn", "post_fn", "id")
if ( !all(expected_names %in% names(aggregations)) ) {
stop(sprintf(
Expand Down
2 changes: 0 additions & 2 deletions facebook/delphiFacebook/R/count.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ get_hh_count_indicators <- function() {
"smoothed_wili", "weight", "hh_p_ili", 6, compute_count_response, jeffreys_count
)

ind$skip_mixing <- FALSE

return(ind)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
geo_id,val,se,sample_size,effective_sample_size
01000,31.7690877,14.0268874,6,10.0169988
01000,31.6221597,13.9770396,6,10.0681877
01097,50,28.8675135,2,2
02000,16.6666667,21.5165741,2,2
04000,40.5122736,23.0968952,3.0005,3.5175897
04000,40.388547,22.8643303,3.0005,3.6054383
04013,8.3333333,11.2833867,5,5
04019,7.1428574,9.7340738,5.9995,5.9999998
04019,7.1428573,9.7340737,5.9995,5.9999998
05000,6.25,8.558165,4,7
05007,12.5,16.5359457,3,3
06000,27.505253,9.9849551,17.001,18.9999978
06001,12.486898,16.51985,3.0021,3.0041971
06000,27.5049905,9.9849255,17.001,18.999998
06001,12.2581137,16.2383585,3.0021,3.078931
06013,37.5,24.2061459,3,3
06019,12.5000201,16.5359703,2.9969,2.9999936
06019,12.5000181,16.5359679,2.9969,2.9999942
06037,27.7777778,14.9301069,8,8
06065,12.5,16.5359457,3,3
06071,16.6666667,21.5165741,2,2
06073,12.5,16.5359457,3,3
06097,16.6666667,21.5165741,2,2
06111,12.5,16.5359457,3,3
08000,48.6841272,18.1339282,5,6.5972309
08000,48.5051863,18.0235423,5,6.6890267
08035,16.6666667,21.5165741,2,2
08077,12.5,16.5359457,3,3
09000,10.0000068,13.4164165,3,3.9999966
09000,10.0000061,13.4164156,3,3.9999969
09003,50,28.8675135,2,2
09011,16.6666667,21.5165741,2,2
12000,4.2099357,3.364264,26.8207,34.6299981
12071,58.3031206,20.11828,5.0032,5.0063918
12000,4.1978342,3.3548053,26.8207,34.732712
12071,57.9092258,20.0083059,5.0032,5.0885522
12086,16.6666667,21.5165741,2,2
12103,37.5,24.2061459,3,3
12105,37.5,24.2061459,3,3
12115,15.0055988,19.5642628,2.1762,2.3320896
12115,14.5733531,19.0489554,2.1762,2.4309194
12127,50,28.8675135,2,2
13000,15.5172414,6.7234519,13.0151,28
13121,12.5000176,16.5359673,2.9971,2.9999944
13153,37.6021852,24.2195833,2.9878,2.9999
13121,12.5000158,16.5359652,2.9971,2.9999949
13153,37.597071,24.2188992,2.9878,2.9999097
13215,16.6666667,21.5165741,2,2
16000,6.2358147,8.5393869,4,7.0181985
17000,29.2997422,9.4804187,14.077,22.047815
17031,14.0648309,10.5106783,9.5695,9.940671
17043,18.5651223,14.7219817,5.6417,5.975506
17089,21.8004914,22.3150372,2.2086,2.4235374
17097,10.4769089,14.0189569,3.5032,3.7724
16000,6.1962613,8.4870116,4,7.0693821
17000,29.2013046,9.4373721,14.077,22.2126834
17031,13.9721738,10.4368006,9.5695,10.0348938
17043,18.542798,14.6247428,5.6417,6.0620093
17089,22.0114386,22.0823097,2.2086,2.5203865
17097,10.4309112,13.9609935,3.5032,3.7934451
17201,16.6666667,21.5165741,2,2
18000,7.1428571,9.7340735,5,6
18039,12.5,16.5359457,3,3
18097,50,28.8675135,2,2
19000,30.7414781,10.9088761,11.9005,16.8911371
20000,35.7223943,12.022083,7.9999,14.8869601
19000,30.7241508,10.9040911,11.9005,16.9012271
20000,35.666551,12.0139468,7.9999,14.8974162
21000,18.75,13.7996264,6,7
21117,16.6666667,21.5165741,2,2
22000,4.1666667,5.7684888,9,11
23000,8.3305565,11.2797976,5,5.002
24000,6.018989,8.2519883,4.6661,7.307043
24003,13.3039163,17.518392,2.3339,2.7582918
23000,8.2600353,11.1886113,5,5.0532429
24000,5.9431557,8.151308,4.6661,7.4130389
24003,13.2270541,17.4249002,2.3339,2.7801312
24033,12.5,16.5359457,3,3
25000,16.6666667,21.5165741,2,2
25013,12.5,16.5359457,3,3
25015,16.6666667,21.5165741,2,2
25017,83.3333333,21.5165741,2,2
25023,50,22.3606798,4,4
25027,25,17.6776695,5,5
26000,13.7806356,8.092853,15,17.1413983
26000,13.7038929,8.0513657,15,17.2429914
26081,37.5,24.2061459,3,3
26125,13.2443259,17.445917,2.4974,2.7752016
26161,48.9749215,28.2908717,2.0622,2.1222291
26163,13.4606479,17.7087449,2.4404,2.7145315
27000,25.0536619,11.569499,9.1077,13.0278955
27123,28.3497447,20.1742272,3.8923,3.9908335
28000,4.1571392,5.7555847,7,11.027502
26125,13.1730567,17.3591643,2.4974,2.7956263
26161,48.4455425,28.0050309,2.0622,2.184549
26163,13.3691556,17.5976732,2.4404,2.739952
27000,25.1539916,11.5637956,9.1077,13.0790952
27123,28.4317511,20.1900157,3.8923,3.9917254
28000,4.139539,5.7317434,7,11.0786396
29000,6.25,8.558165,6,7
29077,50,28.8675135,2,2
30000,5,6.8920244,5,9
Expand All @@ -81,63 +81,63 @@ geo_id,val,se,sample_size,effective_sample_size
34029,12.5,16.5359457,3,3
34031,50,28.8675135,2,2
35049,50,28.8675135,2,2
36000,8.8270685,6.6494005,16,17.2019297
36000,8.9421177,6.6700625,16,17.3019819
36001,37.5,24.2061459,3,3
36029,10,13.4164079,4,4
36055,30,20.4939015,4,4
36059,16.6666667,21.5165741,2,2
36065,12.5,16.5359457,3,3
36081,16.6666667,21.5165741,2,2
36091,16.6666667,21.5165741,2,2
37000,11.6649301,5.1682375,23.391,37.5771708
37067,12.5960429,16.6538511,2.5543,2.9695006
37081,16.0848908,20.8378638,2.0548,2.1085073
39000,12.5692729,6.1120549,16.005,28.4170929
39007,16.6444852,21.4907976,2.002,2.003998
37000,11.598099,5.140571,23.391,37.7994618
37067,12.5867004,16.6423883,2.5543,2.972447
37081,15.5742914,20.2376766,2.0548,2.2104189
39000,12.4445536,6.0592721,16.005,28.6771079
39007,16.2811422,21.0674278,2.002,2.0710376
39017,16.6666667,21.5165741,2,2
39035,16.6666667,21.5165741,2,2
39151,37.5,24.2061459,3,3
39153,12.5000248,16.5359761,2.9932,2.9999921
39153,12.5000223,16.5359731,2.9932,2.9999928
40000,50,22.3606798,4,4
40143,30,20.4939015,4,4
41000,21.804397,15.5111186,5,6.0866368
41000,22.0444252,15.5169637,5,6.1372757
41039,37.5,24.2061459,3,3
41047,16.6666667,21.5165741,2,2
42000,21.3024081,10.8492019,10.6906,13.2427733
42003,41.6536709,20.1199839,5.0018,5.0035974
42000,21.4185866,10.813697,10.6906,13.3933622
42003,41.3531393,19.9623908,5.0018,5.0859467
42027,12.5,16.5359457,3,3
42029,12.5362496,16.5804639,2.7574,2.9884337
42029,12.5327184,16.576128,2.7574,2.9895575
42033,50,28.8675135,2,2
42043,12.5,16.5359457,3,3
42049,50,28.8675135,2,2
42075,16.6666667,21.5165741,2,2
42077,45.1158137,22.6548801,3.5569,3.824502
42079,12.5000939,16.5360611,2.9933,2.9999699
42077,45.3559052,22.626846,3.5569,3.8409326
42079,12.5000848,16.5360498,2.9933,2.9999729
42133,50,28.8675135,2,2
44003,50,28.8675135,2,2
45000,10.7142857,8.2662509,7.0026,13
45019,12.5000035,16.53595,2.9974,2.9999989
45019,12.5000032,16.5359496,2.9974,2.999999
46099,12.5,16.5359457,3,3
47000,29.9323938,11.8246063,8.0001,13.999796
48000,3.8027813,3.0453483,18.1568,38.4448142
48029,21.6741928,15.5825005,5.9009,5.9915507
47000,29.9357865,11.8249823,8.0001,13.9998159
48000,3.7873528,3.0332361,18.1568,38.6054993
48029,21.661643,15.5783199,5.9009,5.9923735
48141,12.5,16.5359457,3,3
48157,10.9186288,14.5739255,3.2506,3.5793296
48201,12.2529848,16.2320387,2.7476,3.0806384
48303,10.0034837,13.420822,3.9443,3.9982587
48157,10.8309231,14.4639731,3.2506,3.6164117
48201,12.0445467,15.974852,2.7476,3.1512563
48303,10.0031441,13.4203917,3.9443,3.9984284
48439,37.5,24.2061459,3,3
49000,11.3984359,15.1733317,3,3.3865668
49000,11.2884397,15.0362322,3,3.4293101
49035,16.6666667,21.5165741,2,2
50000,16.6666667,21.5165741,2,2
51000,18.3822749,7.8286205,14.9646,23.480104
51087,46.5420436,25.5804974,2.0354,2.8022427
51000,18.3092431,7.8010057,14.9646,23.57775
51087,46.0941748,25.5028189,2.0354,2.8203695
51107,12.5,16.5359457,3,3
51710,16.6666667,21.5165741,2,2
51810,16.6666667,21.5165741,2,2
53000,18.75,13.7996264,6,7
53033,50,28.8675135,2,2
53061,16.6666667,21.5165741,2,2
54000,29.1629143,13.1206451,9,10.9999996
55000,7.5663103,5.9395516,11,18.8247222
54000,29.1631019,13.1206699,9,10.9999996
55000,7.560313,5.9350363,11,18.8404485
55079,50,28.8675135,2,2
56000,30,20.4939015,4,4
Loading