IALSA / ialsa-2016-groningen

Maelstrom Harmonization Workshop. Assessing the impact of different harmonization procedures on the analysis results from several real datasets.
GNU General Public License v2.0
1 stars 0 forks source link

Subsetting Age across teams #24

Open andkov opened 8 years ago

andkov commented 8 years ago

Consult sandbox/2016-05-12

> # in the original dataset we observe the following number of ids:
> ds %>% 
+   dplyr::group_by(study_name) %>% 
+   dplyr::summarize(count=n())
Source: local data frame [5 x 2]

  study_name count
      (fctr) (int)
1       alsa  2087
2       lbsl   656
3      satsa  1497
4      share  2598
5      tilda  8504
> 
> 
> # restrict analysis to respondents age 50+
> ds_50 <- ds %>% 
+   dplyr::filter(age_in_years >= 50) 
> 
> ds_50 %>% 
+   dplyr::group_by(study_name) %>% 
+   dplyr::summarize(count=n())
Source: local data frame [5 x 2]

  study_name count
      (fctr) (int)
1       alsa  2087
2       lbsl   582
3      satsa  1240
4      share  2498
5      tilda  8163
andkov commented 8 years ago
> print(get_nonmiss(ds_50, "smoke_now"))
  study_name smoke_now
1       alsa      2068
2       lbsl       490
3      satsa      1180
4      share      2494
5      tilda      8162
> print(get_nonmiss(ds_50, "smoked_ever"))
  study_name smoked_ever
1       alsa        2068
2       lbsl         497
3      satsa        1151
4      share        2494
5      tilda        8162
> print(get_nonmiss(ds_50, "age_in_years"))
  study_name age_in_years
1       alsa         2087
2       lbsl          582
3      satsa         1240
4      share         2498
5      tilda         8163