Given
dta <- data.frame(
PUMFID = c(
30000, 30001, 30003, 30005, 30006, 30007, 30009, 30011, 30012, 30013,
30014, 30015, 30016,
30017, 30019, 30020, 30021, 30022, 30023, 30026
),
PUMFWGHT = c(
25.3256, 10.257, 23.1295, 10.759, 42.7018, 10.9332, 25.9796,
25.5107, 43.9171, 21.1154, 60.9822, 19.3566, 48.5176, 51.538,
23.9373, 64.5496, 169.0191, 11.9627, 33.3693, 84.0422
),
GEO_PC = c(3, 2, 1, 4, 1, 4, 1, 1, 1, 2, 3, 2, 1, 3, 3, 3, 1, 2, 1, 3),
GEO_INU = c(3, 3, 3, 1, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
AGE_YRSG = c(2, 2, 2, 2, 6, 3, 1, 2, 6, 3, 6, 2, 2, 5, 2, 5, 1, 4, 6, 1),
SEX = c(1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1),
PROXY = c(2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1)
)
booted <- data.frame(
PUMFID = c(
30000, 30001, 30003, 30005, 30006, 30007, 30009, 30011, 30012, 30013
),
PUMFWGHT = c(
25.3256, 10.257, 23.1295, 10.759, 42.7018, 10.9332, 25.9796, 25.5107,
43.9171, 21.1154
),
WRPP0001 = c(
22.7792, 10.5725, 21.5607, 10.2069, 37.9878, 10.7163, 22.7959,
24.6361, 51.068, 24.7117
),
WRPP0002 = c(
16.9974, 10.374, 16.6935, 9.8463, 56.3002, 13.0115, 35.7703, 37.7712,
59.1396, 13.2218
),
WRPP0003 = c(
22.6349, 9.9881, 19.8387, 10.7217, 47.0602, 9.9361, 28.2887, 24.6291,
46.5755, 19.2514
)
)
dta
#> PUMFID PUMFWGHT GEO_PC GEO_INU AGE_YRSG SEX PROXY
#> 1 30000 25.3256 3 3 2 1 2
#> 2 30001 10.2570 2 3 2 1 2
#> 3 30003 23.1295 1 3 2 2 2
#> 4 30005 10.7590 4 1 2 2 1
#> 5 30006 42.7018 1 3 6 1 2
#> 6 30007 10.9332 4 2 3 1 2
#> 7 30009 25.9796 1 3 1 1 1
#> 8 30011 25.5107 1 3 2 2 2
#> 9 30012 43.9171 1 3 6 2 2
#> 10 30013 21.1154 2 3 3 1 2
#> 11 30014 60.9822 3 3 6 1 2
#> 12 30015 19.3566 2 3 2 1 2
#> 13 30016 48.5176 1 3 2 2 2
#> 14 30017 51.5380 3 3 5 2 2
#> 15 30019 23.9373 3 3 2 2 2
#> 16 30020 64.5496 3 3 5 1 2
#> 17 30021 169.0191 1 3 1 2 1
#> 18 30022 11.9627 2 3 4 1 2
#> 19 30023 33.3693 1 3 6 2 2
#> 20 30026 84.0422 3 3 1 1 1
booted
#> PUMFID PUMFWGHT WRPP0001 WRPP0002 WRPP0003
#> 1 30000 25.3256 22.7792 16.9974 22.6349
#> 2 30001 10.2570 10.5725 10.3740 9.9881
#> 3 30003 23.1295 21.5607 16.6935 19.8387
#> 4 30005 10.7590 10.2069 9.8463 10.7217
#> 5 30006 42.7018 37.9878 56.3002 47.0602
#> 6 30007 10.9332 10.7163 13.0115 9.9361
#> 7 30009 25.9796 22.7959 35.7703 28.2887
#> 8 30011 25.5107 24.6361 37.7712 24.6291
#> 9 30012 43.9171 51.0680 59.1396 46.5755
#> 10 30013 21.1154 24.7117 13.2218 19.2514
the next step is to put a little formality on the question.
Every R
problem can be thought of with advantage as the interaction of three objects— an existing object, x , a desired object,y , and a function, f, that will return a value of y given x as an argument. In other words, school algebra— f(x) = y. Any of the objects can be composites.
In this case, we have two objects, dta
and booted
. To find, is an f
merge the person-level weights to the variables of interest
Unclear is person-level weights
and variables of interest
Using the f(x) = y
paradigm, what is x and y? From that f can be suggested.