You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A follow up question I had was how to stratify on survey wave, e.g. subset on wave 1 participants in CoMix, and generate the corresponding social contact matrix - at the moment it's returning NA entries (see below), but there's probably something simple I'm not getting.
# get UK CoMix data from 2020-22 - note this is slow to loadcomix_uk<- get_survey("https://zenodo.org/doi/10.5281/zenodo.4905745")
# subset on 1st wave of surveys in April/May 2020comix_uk_wave_1<-comix_ukcomix_uk_wave_1$participants<-comix_uk$participants|> filter(wave==1)
contact_data_comix<-socialmixr::contact_matrix(
comix_uk_wave_1,
countries="United Kingdom",
age.limits= c(0, 5, 18, 40, 65),
symmetric=TRUE
)
> contact_data_comix
$matrix
contact.age.group
[0,5) [5,18) [18,40) [40,65) 65+
[1,] NA NA NA NA NA
[2,] NA NA NA NA NA
[3,] NA NA NA NA NA
[4,] NA NA NA NA NA
[5,] NA NA NA NA NA
$demography
age.group population proportion year
<char> <num> <num> <int>
1: [0,5) 4370647 NA 1950
2: [5,18) 8910009 NA 1950
3: [18,40) 15997248 NA 1950
4: [40,65) 15855240 NA 1950
5: 65+ NA NA 1950
$participants
age.group participants proportion
<char> <int> <num>
1: [0,5) 192 0.1594684385
2: [5,18) 998 0.8289036545
3: [18,40) 1 0.0008305648
4: [40,65) 11 0.0091362126
5: 65+ 2 0.0016611296
Full draft walkthrough is here.
Originally posted by @adamkucharski in #108 (comment)
The text was updated successfully, but these errors were encountered: