-
Notifications
You must be signed in to change notification settings - Fork 0
/
diag_age_bits for all MM.R
210 lines (163 loc) · 9.72 KB
/
diag_age_bits for all MM.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
result_cond_diag_age_all<-mm_cohort_data2 %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="F")
result_cond_diag_age_sex_f<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M")
result_cond_diag_age_sex_m<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="_50")
result_cond_diag_age_age1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="50_59")
result_cond_diag_age_age2<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="60_69")
result_cond_diag_age_age3<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="70_79")
result_cond_diag_age_age4<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="_80")
result_cond_diag_age_age5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, dep_sc=="1")
result_cond_diag_age_dep1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, dep_sc=="5")
result_cond_diag_age_dep5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc) %>%
summarize(median_age= median(diag_age3))
#sex and age
ttt<-filter(mm_cohort_data2, sex=="F" & ageg=="_50")
result_cond_diag_age_agef1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="F" & ageg=="50_59")
result_cond_diag_age_agef2<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="F" & ageg=="60_69")
result_cond_diag_age_agef3<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="F" & ageg=="70_79")
result_cond_diag_age_agef4<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="F" & ageg=="_80")
result_cond_diag_age_agef5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
##sex=m by age dep
ttt<-filter(mm_cohort_data2, sex=="M" & ageg=="_50")
result_cond_diag_age_agem1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M" & ageg=="50_59")
result_cond_diag_age_agem2<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M" & ageg=="60_69")
result_cond_diag_age_agem3<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M" & ageg=="70_79")
result_cond_diag_age_agem4<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M" & ageg=="_80")
result_cond_diag_age_agem5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,ageg,sex) %>%
summarize(median_age= median(diag_age3))
##sex deprivation
ttt<-filter(mm_cohort_data2, sex=="F" & dep_sc=="1")
result_cond_diag_age_depf1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="F" & dep_sc=="5")
result_cond_diag_age_depf5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M" & dep_sc=="1")
result_cond_diag_age_depm1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,sex) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, sex=="M" & dep_sc=="5")
result_cond_diag_age_depm5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,sex) %>%
summarize(median_age= median(diag_age3))
##age by deprivation
ttt<-filter(mm_cohort_data2, ageg=="_50" & dep_sc=="1")
result_cond_diag_age_age1_dep1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="_50" & dep_sc=="5")
result_cond_diag_age_age1_dep5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort2, ageg=="50_59" & dep_sc=="1")
result_cond_diag_age_age2_dep1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort2, ageg=="50_59" & dep_sc=="5")
result_cond_diag_age_age2_dep5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort2, ageg=="60_69" & dep_sc=="1")
result_cond_diag_age_age3_dep1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort2, ageg=="60_69" & dep_sc=="5")
result_cond_diag_age_age3_dep5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort2, ageg=="70_79" & dep_sc=="1")
result_cond_diag_age_age4_dep1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort2, ageg=="70_79" & dep_sc=="5")
result_cond_diag_age_age4_dep5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="_80" & dep_sc=="1")
result_cond_diag_age_age5_dep1<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
ttt<-filter(mm_cohort_data2, ageg=="_80" & dep_sc=="5")
result_cond_diag_age_age5_dep5<-ttt %>% ##new conditions per year
group_by(Elixhauser_Index_Phenotypes,dep_sc,ageg) %>%
summarize(median_age= median(diag_age3))
all_cond_diag_age<-cbind.data.frame(result_cond_diag_age_all,result_cond_diag_age_sex_f,result_cond_diag_age_sex_m,result_cond_diag_age_age1,
result_cond_diag_age_age2,result_cond_diag_age_age3,result_cond_diag_age_age4,
result_cond_diag_age_dep1,result_cond_diag_age_dep5,result_cond_diag_age_agef1,result_cond_diag_age_agef2,
result_cond_diag_age_agef3,result_cond_diag_age_agef4,
result_cond_diag_age_depf1,result_cond_diag_age_depf5,result_cond_diag_age_agem1,
result_cond_diag_age_agem2,result_cond_diag_age_agem3,result_cond_diag_age_agem4,
result_cond_diag_age_depm1,result_cond_diag_age_depm5,result_cond_diag_age_age1_dep5,result_cond_diag_age_age2_dep1,
result_cond_diag_age_age3_dep1, result_cond_diag_age_age4_dep1, result_cond_diag_age_age2_dep5,
result_cond_diag_age_age3_dep5, result_cond_diag_age_age4_dep5,)
all_cond_diag_age_80<-cbind.data.frame(result_cond_diag_age_age5,result_cond_diag_age_agef5,result_cond_diag_age_agem5,
result_cond_diag_age_age1_dep1,result_cond_diag_age_age5_dep1,result_cond_diag_age_age5_dep5)
fwrite(all_cond_diag_age, file="all_cond_diag_age.csv",sep=",")
fwrite(all_cond_diag_age_80, file="all_cond_diag_age_80.csv",sep=",")
rm(result_cond_diag_age_all,result_cond_diag_age_sex_f,result_cond_diag_age_sex_m,result_cond_diag_age_age1,
result_cond_diag_age_age2,result_cond_diag_age_age3,result_cond_diag_age_age4,
result_cond_diag_age_dep1,result_cond_diag_age_dep5,result_cond_diag_age_agef1,result_cond_diag_age_agef2,
result_cond_diag_age_agef3,result_cond_diag_age_agef4,
result_cond_diag_age_depf1,result_cond_diag_age_depf5,result_cond_diag_age_agem1,
result_cond_diag_age_agem2,result_cond_diag_age_agem3,result_cond_diag_age_agem4,
result_cond_diag_age_depm1,result_cond_diag_age_depm5,result_cond_diag_age_age1_dep5,
result_cond_diag_age_age5,result_cond_diag_age_agef5,result_cond_diag_age_agem5,
result_cond_diag_age_age1_dep1, result_cond_diag_age_age1_dep5,result_cond_diag_age_age2_dep1,
result_cond_diag_age_age3_dep1, result_cond_diag_age_age4_dep1, result_cond_diag_age_age2_dep5,
result_cond_diag_age_age3_dep5, result_cond_diag_age_age4_dep5,result_cond_diag_age_age5_dep1,result_cond_diag_age_age5_dep5)