-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPHOSPCOVID19FU_R_2021-02-10_1805.r
5583 lines (5576 loc) · 528 KB
/
PHOSPCOVID19FU_R_2021-02-10_1805.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# REDCap label file
## Updated by EMH.
## Hmisc functions replaced with finalfit.
## All labels cut and pasted to NP++
## Changed to data frame
# phosp_var_label = read_xlsx("phosp_var_label.xlsx")
# paste0(phosp_var_label$var," = ff_label(", phosp_var_label$var, ", '", phosp_var_label$label, "')") %>%
# cat(sep = "\n")
# See end
library(finalfit)
#Setting Factors(will create new variable for factors)
data$redcap_event_name = factor(data$redcap_event_name,levels=c("hospital_discharge_arm_1","6_weeks_arm_1","3_months_1st_resea_arm_1","add_planned_clinic_arm_1","12_months_2nd_rese_arm_1","unscheduled_arm_1"))
data$redcap_repeat_instrument = factor(data$redcap_repeat_instrument,levels=c("repeatable_medications_log","repeatable_sarscov2_swab_pcr_test_result","repeatable_pulmonary_functional_tests","repeatable_walk_test_6_min_iswt_15_level","repeatable_laboratory_results_collection_log_routi","repeatable_laboratory_results_collection_log_urine","repeatable_laboratory_results_collection_log_immun","repeatable_laboratory_results_collection_log_addit","crf4a_clinical_data_section","crf4b_research_data_section","repeatable_eq5d5l","repeatable_general_anxiety_disorder_7_questionnair","repeatable_patient_health_questionnaire9_phq9","repeatable_mrc_dyspnoea_scale","repeatable_sarcf_questionnaire","repeatable_general_practice_physical_activity_ques","repeatable_dyspnoea12","repeatable_facit_fatigue_scale_v4","repeatable_ptsd_checklist_for_dsm5_pcl5","repeatable_brief_pain_inventory_short_form","repeatable_nottingham_extended_adl_scale","repeatable_montreal_cognitive_assessment_moca","repeatable_rockwood_clinical_frailty_scale","repeatable_tier_2_biological_research_samples_chec","repeatable_tier_2_core_sample_notification_form_bl","repeatable_symptoms_assessment","crf_emergency_visit","adverse_events_log","withdrawals"))
data$redcap_data_access_group = factor(data$redcap_data_access_group,levels=c("addenbrookes_hospi","aintree_university","aneurin_bevan___7a","barnet_hospital__r","barts_health_nhs_t","belfast_city_hospi","bradford_royal_inf","bronglais_general","castle_hill_hospit","churchill_hospital","dumfries__galloway","ealing_hospital__r","glangwili_hospital","glasgow_royal_infi","glenfield_hospital","guys_hospital_and","gwynedd_hospital_","hammersmith_hospit","harefield_hospital","hillingdon_hospita","kings_college_hosp","manchester_royal_i","morristonsingleton","ninewells_hospital","northwick_park_hos","nottingham_city_ho","prince_philip_hosp","queen_elizabeth_ho","royal_brompton_hos","royal_free_hospita","royal_hallamshire","royal_papworth_hos","royal_victoria_inf","salford_royal_hosp","southampton_genera","southmead_hospital","st_georges_hospita","st_marys_hospital","st_jamess_universi","the_whittington_ho","university_college","university_hospita","withybush_general","wrexham_maelor_hos","wythenshawe_hospit","ysbyty_glan_clwyd"))
data$econsent_site = factor(data$econsent_site,levels=c("RGT01","REM21","7A6","RAL26","R1H","ZT001","RAE01","7A2AJ","RWA16","RTH02","SY9","R1K04","SV9","7A2AA","G107H","RWEAE","RJ1","7A1AU","RYJ03","RT301","RRK97","RAS01","RJZ01","R0A02","7A3","ST9","RAPNM","R1K01","RX1CC","7A2AL","RTHH6","G405H","SH9","C418H","RT302","RAL01","RHQHH","S314H","REMRQ","RGM22","RTD02","RM3","RHM01","RVJ01","RJ701","RYJ01","RR813","RKEQ4","RRV","L302H","7A4C1","L106H","L308H","7A2BL","7A1A4","R0A07","7A1A1"))
data$phosp_id_complete = factor(data$phosp_id_complete,levels=c("0","1","2"))
data$econsent_q1 = factor(data$econsent_q1,levels=c("1","0"))
data$econsent_q2 = factor(data$econsent_q2,levels=c("1","0"))
data$econsent_q3 = factor(data$econsent_q3,levels=c("1","0"))
data$econsent_q4 = factor(data$econsent_q4,levels=c("1","0"))
data$econsent_q5 = factor(data$econsent_q5,levels=c("1","0"))
data$econsent_q6 = factor(data$econsent_q6,levels=c("1","0"))
data$econsent_q7 = factor(data$econsent_q7,levels=c("1","0"))
data$econsent_q8 = factor(data$econsent_q8,levels=c("1","0"))
data$econsent_q8_pt2 = factor(data$econsent_q8_pt2,levels=c("1","0"))
data$econsent_q9 = factor(data$econsent_q9,levels=c("1","0"))
data$econsent_q10 = factor(data$econsent_q10,levels=c("1","0"))
data$econsent_q11 = factor(data$econsent_q11,levels=c("1","0"))
data$econsent_q12 = factor(data$econsent_q12,levels=c("1","0"))
data$econsent_q13 = factor(data$econsent_q13,levels=c("1","0"))
data$econsent_q14 = factor(data$econsent_q14,levels=c("1","0"))
data$econsent_q15 = factor(data$econsent_q15,levels=c("1","0"))
data$econsent_q16 = factor(data$econsent_q16,levels=c("1","0"))
data$econsent_q17 = factor(data$econsent_q17,levels=c("1","0"))
data$econsent_q18 = factor(data$econsent_q18,levels=c("1","0"))
data$econsent_complete = factor(data$econsent_complete,levels=c("0","1","2"))
data$consent_ver = factor(data$consent_ver,levels=c("1","3","6","9","16","13","2","4","5","10","17","14","7","11","18","15","8","12"))
data$consent_v2_q1 = factor(data$consent_v2_q1,levels=c("1","0"))
data$consent_v3_q1 = factor(data$consent_v3_q1,levels=c("1","0"))
data$consent_sa2_q1 = factor(data$consent_sa2_q1,levels=c("1","0"))
data$consent_sa3_q1 = factor(data$consent_sa3_q1,levels=c("1","0"))
data$consent_sa4_q1 = factor(data$consent_sa4_q1,levels=c("1","0"))
data$consent_nsa1_q1 = factor(data$consent_nsa1_q1,levels=c("1","0"))
data$consent_q2 = factor(data$consent_q2,levels=c("1","0"))
data$consent_q3 = factor(data$consent_q3,levels=c("1","0"))
data$consent_q4 = factor(data$consent_q4,levels=c("1","0"))
data$consent_q5 = factor(data$consent_q5,levels=c("1","0"))
data$consent_nsa1_q6 = factor(data$consent_nsa1_q6,levels=c("1","0"))
data$consent_q6 = factor(data$consent_q6,levels=c("1","0"))
data$consent_q7 = factor(data$consent_q7,levels=c("1","0"))
data$consent_q7_pt2 = factor(data$consent_q7_pt2,levels=c("1","0"))
data$consent_q8 = factor(data$consent_q8,levels=c("1","0"))
data$consent_q9 = factor(data$consent_q9,levels=c("1","0"))
data$consent_q10 = factor(data$consent_q10,levels=c("1","0"))
data$consent_q11 = factor(data$consent_q11,levels=c("1","0"))
data$consent_q12 = factor(data$consent_q12,levels=c("1","0"))
data$consent_q13 = factor(data$consent_q13,levels=c("1","0"))
data$consent_q14 = factor(data$consent_q14,levels=c("1","0"))
data$consent_q15 = factor(data$consent_q15,levels=c("1","0"))
data$consent_q16 = factor(data$consent_q16,levels=c("1","0"))
data$consent_q17 = factor(data$consent_q17,levels=c("1","0"))
data$consultee_q1 = factor(data$consultee_q1,levels=c("1","0"))
data$consultee_v2_q1 = factor(data$consultee_v2_q1,levels=c("1","0"))
data$consultee_q2 = factor(data$consultee_q2,levels=c("1","0"))
data$consultee_q3 = factor(data$consultee_q3,levels=c("1","0"))
data$consultee_q4 = factor(data$consultee_q4,levels=c("1","0"))
data$consultee_q5 = factor(data$consultee_q5,levels=c("1","0"))
data$consultee_q6 = factor(data$consultee_q6,levels=c("1","0"))
data$consultee_q7 = factor(data$consultee_q7,levels=c("1","0"))
data$consultee_q8 = factor(data$consultee_q8,levels=c("1","0"))
data$consultee_q9 = factor(data$consultee_q9,levels=c("1","0"))
data$consultee_q10 = factor(data$consultee_q10,levels=c("1","0"))
data$consultee_q11 = factor(data$consultee_q11,levels=c("1","0"))
data$consultee_q12 = factor(data$consultee_q12,levels=c("1","0"))
data$consultee_q13 = factor(data$consultee_q13,levels=c("1","0"))
data$consultee_type = factor(data$consultee_type,levels=c("1","2"))
data$consultee_signed_verified = factor(data$consultee_signed_verified,levels=c("1","0"))
data$consent_signature_verified = factor(data$consent_signature_verified,levels=c("1","0"))
data$consent_countsign_verified = factor(data$consent_countsign_verified,levels=c("1","0"))
data$consent_witness_sign = factor(data$consent_witness_sign,levels=c("1","0"))
data$registration_and_informed_consent_complete = factor(data$registration_and_informed_consent_complete,levels=c("0","1","2"))
data$split_tier_ver = factor(data$split_tier_ver,levels=c("1","2","3"))
data$split_tier1_q1 = factor(data$split_tier1_q1,levels=c("1","0"))
data$split_tier1_q2 = factor(data$split_tier1_q2,levels=c("1","0"))
data$split_tier1_q3 = factor(data$split_tier1_q3,levels=c("1","0"))
data$split_tier1_q4 = factor(data$split_tier1_q4,levels=c("1","0"))
data$split_tier1_q5 = factor(data$split_tier1_q5,levels=c("1","0"))
data$split_tier1_q6 = factor(data$split_tier1_q6,levels=c("1","0"))
data$split_tier1_q7 = factor(data$split_tier1_q7,levels=c("1","0"))
data$split_tier1_q7pt2 = factor(data$split_tier1_q7pt2,levels=c("1","0"))
data$split_tier1_q8 = factor(data$split_tier1_q8,levels=c("1","0"))
data$split_tier1_q9 = factor(data$split_tier1_q9,levels=c("1","0"))
data$split_tier1_q10 = factor(data$split_tier1_q10,levels=c("1","0"))
data$split_tier1_q11 = factor(data$split_tier1_q11,levels=c("1","0"))
data$split_tier1_q12 = factor(data$split_tier1_q12,levels=c("1","0"))
data$split_tier1_q13 = factor(data$split_tier1_q13,levels=c("1","0"))
data$split_tier1_q14 = factor(data$split_tier1_q14,levels=c("1","0"))
data$split_tier1_q15 = factor(data$split_tier1_q15,levels=c("1","0"))
data$split_tier1_q16 = factor(data$split_tier1_q16,levels=c("1","0"))
data$split_tier1_q17 = factor(data$split_tier1_q17,levels=c("1","0"))
data$split_tier1_q18 = factor(data$split_tier1_q18,levels=c("1","0"))
data$split_tier1_parti_sign = factor(data$split_tier1_parti_sign,levels=c("1","0"))
data$split_tier1_research_sign = factor(data$split_tier1_research_sign,levels=c("1","0"))
data$split_tier1_witness_sign = factor(data$split_tier1_witness_sign,levels=c("1","0"))
data$split_tier2_q1 = factor(data$split_tier2_q1,levels=c("1","0"))
data$split_tier2_q2 = factor(data$split_tier2_q2,levels=c("1","0"))
data$split_tier2_q3 = factor(data$split_tier2_q3,levels=c("1","0"))
data$split_tier2_q4 = factor(data$split_tier2_q4,levels=c("1","0"))
data$split_tier2_parti_sign = factor(data$split_tier2_parti_sign,levels=c("1","0"))
data$split_tier2_research_sign = factor(data$split_tier2_research_sign,levels=c("1","0"))
data$split_tier2_witness_sign = factor(data$split_tier2_witness_sign,levels=c("1","0"))
data$split_tier_recruitment_informed_consent_2_complete = factor(data$split_tier_recruitment_informed_consent_2_complete,levels=c("0","1","2"))
data$inc_1 = factor(data$inc_1,levels=c("1","0"))
data$inc_2 = factor(data$inc_2,levels=c("1","0"))
data$inc_3 = factor(data$inc_3,levels=c("1","0"))
data$exc_1 = factor(data$exc_1,levels=c("1","0"))
data$exc_2 = factor(data$exc_2,levels=c("1","0"))
data$exc_3 = factor(data$exc_3,levels=c("1","0"))
data$exc_4 = factor(data$exc_4,levels=c("1","0"))
data$eligibility_checklist_complete = factor(data$eligibility_checklist_complete,levels=c("0","1","2"))
data$crf0_version = factor(data$crf0_version,levels=c("1","2","3"))
data$crf0_identifiable_patient_information_complete = factor(data$crf0_identifiable_patient_information_complete,levels=c("0","1","2"))
data$crf1a1_version = factor(data$crf1a1_version,levels=c("1","2","3","4","5","6","7"))
data$crf1a_sex = factor(data$crf1a_sex,levels=c("M","F"))
data$crf1a_pregnant_yn = factor(data$crf1a_pregnant_yn,levels=c("1","0","NK"))
data$crf1a_post_partum_yn = factor(data$crf1a_post_partum_yn,levels=c("1","0","NK"))
data$crf1a_pregnancy_outcome = factor(data$crf1a_pregnancy_outcome,levels=c("1","2","NK"))
data$crf1a_delivery_date_yn = factor(data$crf1a_delivery_date_yn,levels=c("1","0"))
data$crf1a_infant_c19_tested_yn = factor(data$crf1a_infant_c19_tested_yn,levels=c("1","0","NK"))
data$crf1a_infant_c19_result_1 = factor(data$crf1a_infant_c19_result_1,levels=c("1","0","2"))
data$crf1a_date_first_sympt_yn = factor(data$crf1a_date_first_sympt_yn,levels=c("1","0"))
data$crf1a_date_adm_yn = factor(data$crf1a_date_adm_yn,levels=c("1","0"))
data$crf1a_re_adm_with_c19 = factor(data$crf1a_re_adm_with_c19,levels=c("1","0","NK"))
data$crf1a_xfer_in = factor(data$crf1a_xfer_in,levels=c("1","0","NK"))
data$crf1aprev_hosp_name_known = factor(data$crf1aprev_hosp_name_known,levels=c("1","0"))
data$crf1a_prev_adm_date_known = factor(data$crf1a_prev_adm_date_known,levels=c("1","0"))
data$crf1a_date_dis_yn = factor(data$crf1a_date_dis_yn,levels=c("1","0"))
data$crf1a_sev_dehydr = factor(data$crf1a_sev_dehydr,levels=c("1","0","NK"))
data$crf1a_stcap_refill_2s = factor(data$crf1a_stcap_refill_2s,levels=c("1","0","NK"))
data$crf1a_supp_o2 = factor(data$crf1a_supp_o2,levels=c("1","2","NK"))
data$crf1a_fever_history = factor(data$crf1a_fever_history,levels=c("1","0","2"))
data$crf1a_cough = factor(data$crf1a_cough,levels=c("1","0","2"))
data$crf1a_cough_sputum = factor(data$crf1a_cough_sputum,levels=c("1","0","2"))
data$crf1a_cough_blood = factor(data$crf1a_cough_blood,levels=c("1","0","2"))
data$crf1a_sore_throat = factor(data$crf1a_sore_throat,levels=c("1","0","2"))
data$crf1a_runny_nose = factor(data$crf1a_runny_nose,levels=c("1","0","2"))
data$crf1a_ear_pain = factor(data$crf1a_ear_pain,levels=c("1","0","2"))
data$crf1a_wheezing = factor(data$crf1a_wheezing,levels=c("1","0","2"))
data$crf1a_chest_pain = factor(data$crf1a_chest_pain,levels=c("1","0","2"))
data$crf1a_muscle_aches = factor(data$crf1a_muscle_aches,levels=c("1","0","2"))
data$crf1a_join_pain = factor(data$crf1a_join_pain,levels=c("1","0","2"))
data$crf1a_fatigue = factor(data$crf1a_fatigue,levels=c("1","0","2"))
data$crf1a_shortness_breath = factor(data$crf1a_shortness_breath,levels=c("1","0","2"))
data$crf1a_loss_taste = factor(data$crf1a_loss_taste,levels=c("1","0","2"))
data$crf1a_loss_smell = factor(data$crf1a_loss_smell,levels=c("1","0","2"))
data$crf1a_chest_indrawing = factor(data$crf1a_chest_indrawing,levels=c("1","0","2"))
data$crf1a_headache = factor(data$crf1a_headache,levels=c("1","0","2"))
data$crf1a_confusion = factor(data$crf1a_confusion,levels=c("1","0","2"))
data$crf1a_seizures = factor(data$crf1a_seizures,levels=c("1","0","2"))
data$crf1a_pain = factor(data$crf1a_pain,levels=c("1","0","2"))
data$crf1a_nausea = factor(data$crf1a_nausea,levels=c("1","0","2"))
data$crf1a_diarrhoea = factor(data$crf1a_diarrhoea,levels=c("1","0","2"))
data$crf1a_conjunctivitis = factor(data$crf1a_conjunctivitis,levels=c("1","0","2"))
data$crf1a_skin_rash = factor(data$crf1a_skin_rash,levels=c("1","0","2"))
data$crf1a_skin_ulcers = factor(data$crf1a_skin_ulcers,levels=c("1","0","2"))
data$crf1a_lymphadenopathy = factor(data$crf1a_lymphadenopathy,levels=c("1","0","2"))
data$crf1a_bleeding = factor(data$crf1a_bleeding,levels=c("1","0","2"))
data$crf1a_bleeding_site_known = factor(data$crf1a_bleeding_site_known,levels=c("1","0"))
data$crf1a_immunosuppressant = factor(data$crf1a_immunosuppressant,levels=c("1","0","2"))
data$crf1a_anti_infectives = factor(data$crf1a_anti_infectives,levels=c("1","0","2"))
data$crf1a_acei = factor(data$crf1a_acei,levels=c("1","0","2"))
data$crf1a_abbs = factor(data$crf1a_abbs,levels=c("1","0","2"))
data$crf1a_nsaid = factor(data$crf1a_nsaid,levels=c("1","0","2"))
data$crf1a_con_meds_comp_yn = factor(data$crf1a_con_meds_comp_yn,levels=c("1","0"))
data$crf1a_baseline_clinical_data_part_1_q1_q8_complete = factor(data$crf1a_baseline_clinical_data_part_1_q1_q8_complete,levels=c("0","1","2"))
data$crf1a2_version = factor(data$crf1a2_version,levels=c("1","2","3","4","5","6","7"))
data$crf1a_com_card_mi = factor(data$crf1a_com_card_mi,levels=c("1","0"))
data$crf1a_com_card_ihd = factor(data$crf1a_com_card_ihd,levels=c("1","0"))
data$crf1a_com_card_af = factor(data$crf1a_com_card_af,levels=c("1","0"))
data$crf1a_com_card_ht = factor(data$crf1a_com_card_ht,levels=c("1","0"))
data$crf1a_com_card_chf = factor(data$crf1a_com_card_chf,levels=c("1","0"))
data$crf1a_com_card_chd = factor(data$crf1a_com_card_chd,levels=c("1","0"))
data$crf1a_com_card_vhd = factor(data$crf1a_com_card_vhd,levels=c("1","0"))
data$crf1a_com_card_pid = factor(data$crf1a_com_card_pid,levels=c("1","0"))
data$crf1a_com_card_pvd = factor(data$crf1a_com_card_pvd,levels=c("1","0"))
data$crf1a_com_card_hcd = factor(data$crf1a_com_card_hcd,levels=c("1","0"))
data$crf1a_com_card_catia = factor(data$crf1a_com_card_catia,levels=c("1","2","0"))
data$crf1a_com_card_other_yn = factor(data$crf1a_com_card_other_yn,levels=c("1","0"))
data$crf1a_com_neupsy_dem = factor(data$crf1a_com_neupsy_dem,levels=c("1","0"))
data$crf1a_com_neupsy_other_yn = factor(data$crf1a_com_neupsy_other_yn,levels=c("1","0"))
data$crf1a_com_neupsy_da = factor(data$crf1a_com_neupsy_da,levels=c("1","0"))
data$crf1a_com_neupsy_chron = factor(data$crf1a_com_neupsy_chron,levels=c("1","0"))
data$crf1a_com_neupsy_pam = factor(data$crf1a_com_neupsy_pam,levels=c("1","0"))
data$crf1a_com_neupsy_ptm = factor(data$crf1a_com_neupsy_ptm,levels=c("1","0"))
data$crf1a_com_res_copd = factor(data$crf1a_com_res_copd,levels=c("1","0"))
data$crf1a_com_res_ast = factor(data$crf1a_com_res_ast,levels=c("1","0"))
data$crf1a_com_res_ild_yn = factor(data$crf1a_com_res_ild_yn,levels=c("1","0"))
data$crf1a_com_res_bron = factor(data$crf1a_com_res_bron,levels=c("1","0"))
data$crf1a_com_res_osa = factor(data$crf1a_com_res_osa,levels=c("1","0"))
data$crf1a_com_res_ohs = factor(data$crf1a_com_res_ohs,levels=c("1","0"))
data$crf1a_com_res_pe = factor(data$crf1a_com_res_pe,levels=c("1","0"))
data$crf1a_com_res_other_yn = factor(data$crf1a_com_res_other_yn,levels=c("1","0"))
data$crf1a_com_rheu_ctd = factor(data$crf1a_com_rheu_ctd,levels=c("1","0"))
data$crf1a_com_rheu_ra = factor(data$crf1a_com_rheu_ra,levels=c("1","0"))
data$crf1a_com_rheu_ost = factor(data$crf1a_com_rheu_ost,levels=c("1","0"))
data$crf1a_com_rheu_other_yn = factor(data$crf1a_com_rheu_other_yn,levels=c("1","0"))
data$crf1a_com_gast_pud = factor(data$crf1a_com_gast_pud,levels=c("1","0"))
data$crf1a_com_gast_ld = factor(data$crf1a_com_gast_ld,levels=c("1","2","0"))
data$crf1a_com_gast_gord = factor(data$crf1a_com_gast_gord,levels=c("1","0"))
data$crf1a_com_gast_ibd = factor(data$crf1a_com_gast_ibd,levels=c("1","0"))
data$crf1a_com_gast_ibs = factor(data$crf1a_com_gast_ibs,levels=c("1","0"))
data$crf1a_com_gast_other_yn = factor(data$crf1a_com_gast_other_yn,levels=c("1","0"))
data$crf1a_com_mer_diab = factor(data$crf1a_com_mer_diab,levels=c("1","2","0"))
data$crf1a_com_mer_diab_com = factor(data$crf1a_com_mer_diab_com,levels=c("1","2"))
data$crf1a_com_mer_hypot = factor(data$crf1a_com_mer_hypot,levels=c("1","0"))
data$crf1a_com_mer_hypert = factor(data$crf1a_com_mer_hypert,levels=c("1","0"))
data$crf1a_com_mer_ckd_yn = factor(data$crf1a_com_mer_ckd_yn,levels=c("1","0"))
data$crf1a_com_mer_other_yn = factor(data$crf1a_com_mer_other_yn,levels=c("1","0"))
data$crf1a_com_mer_ckd_stage = factor(data$crf1a_com_mer_ckd_stage,levels=c("1","2","3","4","5"))
data$crf1a_com_mh_stm = factor(data$crf1a_com_mh_stm,levels=c("1","2","0"))
data$crf1a_com_mh_leuk_yn = factor(data$crf1a_com_mh_leuk_yn,levels=c("1","0"))
data$crf1a_com_mh_lymp_yn = factor(data$crf1a_com_mh_lymp_yn,levels=c("1","0"))
data$crf1a_com_mh_other_yn = factor(data$crf1a_com_mh_other_yn,levels=c("1","0"))
data$crf1a_com_id_aids = factor(data$crf1a_com_id_aids,levels=c("1","0"))
data$crf1a_com_id_hiv = factor(data$crf1a_com_id_hiv,levels=c("1","0"))
data$crf1a_com_id_cvh = factor(data$crf1a_com_id_cvh,levels=c("0","1","2"))
data$crf1a_com_id_mt = factor(data$crf1a_com_id_mt,levels=c("0","1","2","3"))
data$crf1a_com_id_other_yn = factor(data$crf1a_com_id_other_yn,levels=c("1","0"))
data$crf1a_baseline_clinical_data_part_2_q9_complete = factor(data$crf1a_baseline_clinical_data_part_2_q9_complete,levels=c("0","1","2"))
data$crf1a3_version = factor(data$crf1a3_version,levels=c("1","2","3","4","5","6","7"))
data$crf1a_o2_supp = factor(data$crf1a_o2_supp,levels=c("1","0","2"))
data$crf1a_o2_cpapv = factor(data$crf1a_o2_cpapv,levels=c("1","0","2"))
data$crf1a_o2_blniv = factor(data$crf1a_o2_blniv,levels=c("1","0","2"))
data$crf1a_o2_hfn = factor(data$crf1a_o2_hfn,levels=c("1","0","2"))
data$crf1a_o2_imv = factor(data$crf1a_o2_imv,levels=c("1","0","2"))
data$crf1a_o2_ecmo = factor(data$crf1a_o2_ecmo,levels=c("1","0","2"))
data$crf1a_treat_at = factor(data$crf1a_treat_at,levels=c("1","0","NK"))
data$crf1a_treat_ss = factor(data$crf1a_treat_ss,levels=c("1","0","NK"))
data$crf1a_treat_tdac = factor(data$crf1a_treat_tdac,levels=c("1","0","NK"))
data$crf1a_treat_proning = factor(data$crf1a_treat_proning,levels=c("1","0","NK"))
data$crf1a_treat_rrt = factor(data$crf1a_treat_rrt,levels=c("1","0","NK"))
data$crf1a_add_diag_pemt = factor(data$crf1a_add_diag_pemt,levels=c("1","0","NK"))
data$crf1a_add_diag_cvvh = factor(data$crf1a_add_diag_cvvh,levels=c("1","0","NK"))
data$crf1a_add_diag_myoc = factor(data$crf1a_add_diag_myoc,levels=c("1","0","NK"))
data$crf1a_add_diag_cmp = factor(data$crf1a_add_diag_cmp,levels=c("1","0","NK"))
data$crf1a_add_diag = factor(data$crf1a_add_diag,levels=c("1","0","NK"))
data$crf1a_studies___1 = factor(data$crf1a_studies___1,levels=c("0","1"))
data$crf1a_studies___2 = factor(data$crf1a_studies___2,levels=c("0","1"))
data$crf1a_studies___3 = factor(data$crf1a_studies___3,levels=c("0","1"))
data$crf1a_studies___4 = factor(data$crf1a_studies___4,levels=c("0","1"))
data$crf1a_studies___5 = factor(data$crf1a_studies___5,levels=c("0","1"))
data$crf1a_studies___6 = factor(data$crf1a_studies___6,levels=c("0","1"))
data$crf1a_studies___7 = factor(data$crf1a_studies___7,levels=c("0","1"))
data$crf1a_studies___8 = factor(data$crf1a_studies___8,levels=c("0","1"))
data$crf1a_studies___9 = factor(data$crf1a_studies___9,levels=c("0","1"))
data$crf1a_studies___10 = factor(data$crf1a_studies___10,levels=c("0","1"))
data$crf1a_studies___11 = factor(data$crf1a_studies___11,levels=c("0","1"))
data$crf1a_studies___12 = factor(data$crf1a_studies___12,levels=c("0","1"))
data$crf1a_studies___13 = factor(data$crf1a_studies___13,levels=c("0","1"))
data$crf1a_studies___14 = factor(data$crf1a_studies___14,levels=c("0","1"))
data$crf1a_studies___15 = factor(data$crf1a_studies___15,levels=c("0","1"))
data$crf1a_studies___16 = factor(data$crf1a_studies___16,levels=c("0","1"))
data$crf1a_studies___17 = factor(data$crf1a_studies___17,levels=c("0","1"))
data$crf1a_studies___18 = factor(data$crf1a_studies___18,levels=c("0","1"))
data$crf1a_studies___19 = factor(data$crf1a_studies___19,levels=c("0","1"))
data$crf1a_studies___20 = factor(data$crf1a_studies___20,levels=c("0","1"))
data$crf1a_studies___21 = factor(data$crf1a_studies___21,levels=c("0","1"))
data$crf1a_egfr_low = factor(data$crf1a_egfr_low,levels=c("1","2","3"))
data$crf1a_alt_high = factor(data$crf1a_alt_high,levels=c("1","NK"))
data$crf1a_alt_high_less_great = factor(data$crf1a_alt_high_less_great,levels=c("1","2"))
data$crf1a_bnp_done = factor(data$crf1a_bnp_done,levels=c("1","0","NK"))
data$crf1a_bnp_type = factor(data$crf1a_bnp_type,levels=c("1","2"))
data$crf1a_bnp_unit = factor(data$crf1a_bnp_unit,levels=c("1","2"))
data$crf1a_bnp_high_less_great = factor(data$crf1a_bnp_high_less_great,levels=c("1","2"))
data$crf1a_bnp_last = factor(data$crf1a_bnp_last,levels=c("1","2"))
data$crf1a_bnp_last_less_great = factor(data$crf1a_bnp_last_less_great,levels=c("1","2"))
data$crf1a_trop_done = factor(data$crf1a_trop_done,levels=c("1","0","NK"))
data$crf1a_trop_type = factor(data$crf1a_trop_type,levels=c("1","2","3","4"))
data$crf1a_trop_unit = factor(data$crf1a_trop_unit,levels=c("1","2"))
data$crf1a_trop_first_less_great = factor(data$crf1a_trop_first_less_great,levels=c("1","2"))
data$crf1a_trop_high = factor(data$crf1a_trop_high,levels=c("1","2"))
data$crf1a_trop_high_less_great = factor(data$crf1a_trop_high_less_great,levels=c("1","2"))
data$crf1a_haema_not_done___1 = factor(data$crf1a_haema_not_done___1,levels=c("0","1"))
data$crf1a_haema_not_done___2 = factor(data$crf1a_haema_not_done___2,levels=c("0","1"))
data$crf1a_haema_not_done___3 = factor(data$crf1a_haema_not_done___3,levels=c("0","1"))
data$crf1a_haema_not_done___4 = factor(data$crf1a_haema_not_done___4,levels=c("0","1"))
data$crf1a_haema_not_done___5 = factor(data$crf1a_haema_not_done___5,levels=c("0","1"))
data$crf1a_haema_not_done___6 = factor(data$crf1a_haema_not_done___6,levels=c("0","1"))
data$crf1a_haema_not_done___7 = factor(data$crf1a_haema_not_done___7,levels=c("0","1"))
data$crf1a_haema_not_done___8 = factor(data$crf1a_haema_not_done___8,levels=c("0","1"))
data$crf1a_haema_not_done___9 = factor(data$crf1a_haema_not_done___9,levels=c("0","1"))
data$crf1a_haema_not_done___10 = factor(data$crf1a_haema_not_done___10,levels=c("0","1"))
data$crf1a_haema_not_done___11 = factor(data$crf1a_haema_not_done___11,levels=c("0","1"))
data$crf1a_haemo_less_great = factor(data$crf1a_haemo_less_great,levels=c("1","2"))
data$crf1a_wbc_less_great = factor(data$crf1a_wbc_less_great,levels=c("1","2"))
data$crf1a_neutro_less_great = factor(data$crf1a_neutro_less_great,levels=c("1","2"))
data$crf1a_lympho_less_great = factor(data$crf1a_lympho_less_great,levels=c("1","2"))
data$crf1a_eos_less_great = factor(data$crf1a_eos_less_great,levels=c("1","2"))
data$crf1a_plt_less_great = factor(data$crf1a_plt_less_great,levels=c("1","2"))
data$crf1a_mcv_less_great = factor(data$crf1a_mcv_less_great,levels=c("1","2"))
data$crf1a_inr_less_great = factor(data$crf1a_inr_less_great,levels=c("1","2"))
data$crf1a_aptt_less_great = factor(data$crf1a_aptt_less_great,levels=c("1","2"))
data$crf1a_d_dimer_less_great = factor(data$crf1a_d_dimer_less_great,levels=c("1","2"))
data$crf1a_fib_less_great = factor(data$crf1a_fib_less_great,levels=c("1","2"))
data$crf1a_biochem_not_done___1 = factor(data$crf1a_biochem_not_done___1,levels=c("0","1"))
data$crf1a_biochem_not_done___2 = factor(data$crf1a_biochem_not_done___2,levels=c("0","1"))
data$crf1a_biochem_not_done___3 = factor(data$crf1a_biochem_not_done___3,levels=c("0","1"))
data$crf1a_biochem_not_done___4 = factor(data$crf1a_biochem_not_done___4,levels=c("0","1"))
data$crf1a_biochem_not_done___5 = factor(data$crf1a_biochem_not_done___5,levels=c("0","1"))
data$crf1a_biochem_not_done___6 = factor(data$crf1a_biochem_not_done___6,levels=c("0","1"))
data$crf1a_biochem_not_done___7 = factor(data$crf1a_biochem_not_done___7,levels=c("0","1"))
data$crf1a_biochem_not_done___8 = factor(data$crf1a_biochem_not_done___8,levels=c("0","1"))
data$crf1a_biochem_not_done___9 = factor(data$crf1a_biochem_not_done___9,levels=c("0","1"))
data$crf1a_biochem_not_done___10 = factor(data$crf1a_biochem_not_done___10,levels=c("0","1"))
data$crf1a_biochem_not_done___11 = factor(data$crf1a_biochem_not_done___11,levels=c("0","1"))
data$crf1a_biochem_not_done___12 = factor(data$crf1a_biochem_not_done___12,levels=c("0","1"))
data$crf1a_biochem_not_done___13 = factor(data$crf1a_biochem_not_done___13,levels=c("0","1"))
data$crf1a_biochem_not_done___14 = factor(data$crf1a_biochem_not_done___14,levels=c("0","1"))
data$crf1a_na_less_great = factor(data$crf1a_na_less_great,levels=c("1","2"))
data$crf1a_k_less_great = factor(data$crf1a_k_less_great,levels=c("1","2"))
data$crf1a_urea_less_great = factor(data$crf1a_urea_less_great,levels=c("1","2"))
data$crf1a_creat_less_great = factor(data$crf1a_creat_less_great,levels=c("1","2"))
data$crf1a_biochem_egfr_90 = factor(data$crf1a_biochem_egfr_90,levels=c("1","0"))
data$crf1a_alt_less_great = factor(data$crf1a_alt_less_great,levels=c("1","2"))
data$crf1a_alp_less_great = factor(data$crf1a_alp_less_great,levels=c("1","2"))
data$crf1a_bili_less_great = factor(data$crf1a_bili_less_great,levels=c("1","2"))
data$crf1a_crp_less_great = factor(data$crf1a_crp_less_great,levels=c("1","2"))
data$crf1a_ferr_less_great = factor(data$crf1a_ferr_less_great,levels=c("1","2"))
data$crf1a_mg_less_great = factor(data$crf1a_mg_less_great,levels=c("1","2"))
data$crf1a_ser_cor_less_great = factor(data$crf1a_ser_cor_less_great,levels=c("1","2"))
data$crf1a_procal_less_great = factor(data$crf1a_procal_less_great,levels=c("1","2"))
data$crf1a_inter6_less_great = factor(data$crf1a_inter6_less_great,levels=c("1","2"))
data$crf1a_baseline_clinical_data_part_3_q10_q15_complete = factor(data$crf1a_baseline_clinical_data_part_3_q10_q15_complete,levels=c("0","1","2"))
data$crf1b_version = factor(data$crf1b_version,levels=c("1","2","3","4","5","6","7"))
data$crf1b_eth = factor(data$crf1b_eth,levels=c("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","NK"))
data$crf1b_edu = factor(data$crf1b_edu,levels=c("0","1","2","3","4","5","6","7"))
data$crf1b_income = factor(data$crf1b_income,levels=c("1","2","3","4","5","6"))
data$crf1b_disability_yn = factor(data$crf1b_disability_yn,levels=c("1","0","2"))
data$crf1b_living_arrangements = factor(data$crf1b_living_arrangements,levels=c("1","2","3","4","5","6","7","8"))
data$crf1b_gender = factor(data$crf1b_gender,levels=c("1","2","3","4","5","6"))
data$crf1b_gender_identity = factor(data$crf1b_gender_identity,levels=c("1","0","2"))
data$crf1b_english_lang1 = factor(data$crf1b_english_lang1,levels=c("1","0","2"))
data$crf1b_enrolled_in_study = factor(data$crf1b_enrolled_in_study,levels=c("1","2","3"))
data$crf1b_shielding = factor(data$crf1b_shielding,levels=c("1","2","3","4","NK"))
data$crf1b_occupation_known = factor(data$crf1b_occupation_known,levels=c("1","0"))
data$crf1b_healthcare_worker = factor(data$crf1b_healthcare_worker,levels=c("1","0","NK"))
data$crf1b_household___1 = factor(data$crf1b_household___1,levels=c("0","1"))
data$crf1b_household___2 = factor(data$crf1b_household___2,levels=c("0","1"))
data$crf1b_household___3 = factor(data$crf1b_household___3,levels=c("0","1"))
data$crf1b_household___4 = factor(data$crf1b_household___4,levels=c("0","1"))
data$crf1b_household___5 = factor(data$crf1b_household___5,levels=c("0","1"))
data$crf1b_household___6 = factor(data$crf1b_household___6,levels=c("0","1"))
data$crf1b_household___7 = factor(data$crf1b_household___7,levels=c("0","1"))
data$crf1b_household___8 = factor(data$crf1b_household___8,levels=c("0","1"))
data$crf1b_household___nk = factor(data$crf1b_household___nk,levels=c("0","1"))
data$crf1b_caring = factor(data$crf1b_caring,levels=c("0","1","2","3","4","5","6"))
data$crf1b_confirm_comorbids = factor(data$crf1b_confirm_comorbids,levels=c("1","0"))
data$crf1b_baseline_demographic_data_complete = factor(data$crf1b_baseline_demographic_data_complete,levels=c("0","1","2"))
data$crf2a_version = factor(data$crf2a_version,levels=c("1","2","3","4","5","6","7"))
data$crf2a_consultation_method = factor(data$crf2a_consultation_method,levels=c("1","2"))
data$crf2a_not_completed = factor(data$crf2a_not_completed,levels=c("1","0"))
data$crf2a_reason_not_done = factor(data$crf2a_reason_not_done,levels=c("1","2","3","4","5"))
data$crf2a_sex = factor(data$crf2a_sex,levels=c("1","2"))
data$crf2a_pre_con_pulm = factor(data$crf2a_pre_con_pulm,levels=c("1","2"))
data$crf2a_pre_con_card = factor(data$crf2a_pre_con_card,levels=c("1","2"))
data$crf2a_pre_con_diab = factor(data$crf2a_pre_con_diab,levels=c("1","2"))
data$crf2a_pre_con_hypt = factor(data$crf2a_pre_con_hypt,levels=c("1","2"))
data$crf2a_pre_con_other = factor(data$crf2a_pre_con_other,levels=c("1","2"))
data$crf2a_consent = factor(data$crf2a_consent,levels=c("1","0"))
data$crf2a_sta_newmed = factor(data$crf2a_sta_newmed,levels=c("1","0"))
data$crf2a_sta_readm = factor(data$crf2a_sta_readm,levels=c("1","0"))
data$crf2a_sta_other = factor(data$crf2a_sta_other,levels=c("1","0"))
data$crf2a_recovered = factor(data$crf2a_recovered,levels=c("1","2","3"))
data$crf2a_eq5d5l_done = factor(data$crf2a_eq5d5l_done,levels=c("1","0"))
data$crf2a_gppaq_done = factor(data$crf2a_gppaq_done,levels=c("1","0"))
data$crf2a_sarcf_done = factor(data$crf2a_sarcf_done,levels=c("1","0"))
data$crf2a_mrc_done = factor(data$crf2a_mrc_done,levels=c("1","0"))
data$crf2a_rcfs_done = factor(data$crf2a_rcfs_done,levels=c("1","0"))
data$crf2a_health_problem_done = factor(data$crf2a_health_problem_done,levels=c("1","0"))
data$crf2a_mental_done = factor(data$crf2a_mental_done,levels=c("1","0"))
data$crf2a_nutrition_done = factor(data$crf2a_nutrition_done,levels=c("1","0"))
data$crf2a_new_problems = factor(data$crf2a_new_problems,levels=c("1","0"))
data$crf2a_checklist_ai = factor(data$crf2a_checklist_ai,levels=c("1","0"))
data$crf2a_checklist_aii = factor(data$crf2a_checklist_aii,levels=c("1","0"))
data$crf2a_checklist_aiii = factor(data$crf2a_checklist_aiii,levels=c("1","0"))
data$crf2a_checklist_aiv = factor(data$crf2a_checklist_aiv,levels=c("1","0"))
data$crf2a_checklist_av = factor(data$crf2a_checklist_av,levels=c("1","0"))
data$crf2a_checklist_avi = factor(data$crf2a_checklist_avi,levels=c("1","0"))
data$crf2a_checklist_avii1 = factor(data$crf2a_checklist_avii1,levels=c("1","0"))
data$crf2a_checklist_avii2 = factor(data$crf2a_checklist_avii2,levels=c("1","0"))
data$crf2a_checklist_avii3 = factor(data$crf2a_checklist_avii3,levels=c("1","0"))
data$crf2a_checklist_aviii = factor(data$crf2a_checklist_aviii,levels=c("1","0"))
data$crf2a_checklist_aix = factor(data$crf2a_checklist_aix,levels=c("1","0"))
data$crf2a_checklist_ax = factor(data$crf2a_checklist_ax,levels=c("1","0"))
data$crf2a_checklist_axi = factor(data$crf2a_checklist_axi,levels=c("1","0"))
data$crf2a_checklist_b = factor(data$crf2a_checklist_b,levels=c("1","0"))
data$crf2a_checklist_c = factor(data$crf2a_checklist_c,levels=c("1","0"))
data$crf2a_checklist_d = factor(data$crf2a_checklist_d,levels=c("1","0"))
data$crf2a_followup_telephone_triage_complete = factor(data$crf2a_followup_telephone_triage_complete,levels=c("0","1","2"))
data$crf2b_version = factor(data$crf2b_version,levels=c("1","2","3","4","5","6","7"))
data$crf2b_post_dis_cxr_yn = factor(data$crf2b_post_dis_cxr_yn,levels=c("1","0"))
data$crf2b_post_dis_cxr_result = factor(data$crf2b_post_dis_cxr_result,levels=c("1","2","3","4"))
data$crf2b_ct_chest_or_ctpa_yn = factor(data$crf2b_ct_chest_or_ctpa_yn,levels=c("1","0"))
data$crf2b_outcome = factor(data$crf2b_outcome,levels=c("1","2"))
data$crf2b_further_inv___1 = factor(data$crf2b_further_inv___1,levels=c("0","1"))
data$crf2b_further_inv___2 = factor(data$crf2b_further_inv___2,levels=c("0","1"))
data$crf2b_further_inv___3 = factor(data$crf2b_further_inv___3,levels=c("0","1"))
data$crf2b_further_inv___4 = factor(data$crf2b_further_inv___4,levels=c("0","1"))
data$crf2b_followup_triage_review_complete = factor(data$crf2b_followup_triage_review_complete,levels=c("0","1","2"))
data$crf3a_version = factor(data$crf3a_version,levels=c("1","2","3","4","5","6","7","8"))
data$crf3a_visit = factor(data$crf3a_visit,levels=c("3_months_arm_1","12_months_arm_1"))
data$crf3a_rest_spo2_done = factor(data$crf3a_rest_spo2_done,levels=c("1","0"))
data$crf3a_rest_hr_done = factor(data$crf3a_rest_hr_done,levels=c("1","0"))
data$crf3a_rest_bp_done = factor(data$crf3a_rest_bp_done,levels=c("1","0"))
data$crf3a_rest_temp_done = factor(data$crf3a_rest_temp_done,levels=c("1","0"))
data$crf3a_rest_height_done = factor(data$crf3a_rest_height_done,levels=c("1","0"))
data$crf3a_rest_weight_done = factor(data$crf3a_rest_weight_done,levels=c("1","0"))
data$crf3a_base_cxr_done = factor(data$crf3a_base_cxr_done,levels=c("1","2"))
data$crf3a_base_ecg_done = factor(data$crf3a_base_ecg_done,levels=c("1","2"))
data$crf3a_base_cxr = factor(data$crf3a_base_cxr,levels=c("1","2","3","4","5"))
data$crf3a_ecg = factor(data$crf3a_ecg,levels=c("1","2","3","4","5"))
data$crf3a_outcome_fup = factor(data$crf3a_outcome_fup,levels=c("1","0"))
data$crf3a_outcome_ras = factor(data$crf3a_outcome_ras,levels=c("1","0"))
data$crf3a_outcome_rtc = factor(data$crf3a_outcome_rtc,levels=c("1","0"))
data$crf3a_outcome_rpc = factor(data$crf3a_outcome_rpc,levels=c("1","0"))
data$crf3a_outcome_rmhs = factor(data$crf3a_outcome_rmhs,levels=c("1","0"))
data$crf3a_outcome_rrh = factor(data$crf3a_outcome_rrh,levels=c("1","0"))
data$crf3a_outcome_rdt = factor(data$crf3a_outcome_rdt,levels=c("1","0"))
data$crf3a_outcome_rsss = factor(data$crf3a_outcome_rsss,levels=c("1","0"))
data$crf3a_outcome_dis = factor(data$crf3a_outcome_dis,levels=c("1","0"))
data$crf3a_tier = factor(data$crf3a_tier,levels=c("1","2"))
data$crf3a_blood_done = factor(data$crf3a_blood_done,levels=c("1","0"))
data$crf3a_blood_fbc = factor(data$crf3a_blood_fbc,levels=c("1","0"))
data$crf3a_blood_ue = factor(data$crf3a_blood_ue,levels=c("1","0"))
data$crf3a_blood_egfr = factor(data$crf3a_blood_egfr,levels=c("1","0"))
data$crf3a_blood_lfts = factor(data$crf3a_blood_lfts,levels=c("1","0"))
data$crf3a_blood_crp = factor(data$crf3a_blood_crp,levels=c("1","0"))
data$crf3a_blood_bp = factor(data$crf3a_blood_bp,levels=c("1","0"))
data$crf3a_blood_25oh = factor(data$crf3a_blood_25oh,levels=c("1","0"))
data$crf3a_blood_bnp = factor(data$crf3a_blood_bnp,levels=c("1","0"))
data$crf3a_blood_trop = factor(data$crf3a_blood_trop,levels=c("1","0"))
data$crf3a_blood_ddim = factor(data$crf3a_blood_ddim,levels=c("1","0"))
data$crf3a_blood_fib = factor(data$crf3a_blood_fib,levels=c("1","0"))
data$crf3a_blood_inr = factor(data$crf3a_blood_inr,levels=c("1","0"))
data$crf3a_blood_fer = factor(data$crf3a_blood_fer,levels=c("1","0"))
data$crf3a_blood_hba1c = factor(data$crf3a_blood_hba1c,levels=c("1","0"))
data$crf3a_blood_lp = factor(data$crf3a_blood_lp,levels=c("1","0"))
data$crf3a_blood_covid19 = factor(data$crf3a_blood_covid19,levels=c("1","0"))
data$crf3a_link_routine_blood = factor(data$crf3a_link_routine_blood,levels=c("1","0"))
data$crf3a_link_add_blood_sars = factor(data$crf3a_link_add_blood_sars,levels=c("1","0"))
data$crf3a_inv_resp___1 = factor(data$crf3a_inv_resp___1,levels=c("0","1"))
data$crf3a_inv_resp___2 = factor(data$crf3a_inv_resp___2,levels=c("0","1"))
data$crf3a_inv_resp___3 = factor(data$crf3a_inv_resp___3,levels=c("0","1"))
data$crf3a_inv_resp___4 = factor(data$crf3a_inv_resp___4,levels=c("0","1"))
data$crf3a_inv_resp___5 = factor(data$crf3a_inv_resp___5,levels=c("0","1"))
data$crf3a_inv_resp___6 = factor(data$crf3a_inv_resp___6,levels=c("0","1"))
data$crf3a_inv_resp___7 = factor(data$crf3a_inv_resp___7,levels=c("0","1"))
data$crf3a_inv_resp___8 = factor(data$crf3a_inv_resp___8,levels=c("0","1"))
data$crf3a_inv_resp___9 = factor(data$crf3a_inv_resp___9,levels=c("0","1"))
data$crf3a_inv_resp___10 = factor(data$crf3a_inv_resp___10,levels=c("0","1"))
data$crf3a_inv_resp___11 = factor(data$crf3a_inv_resp___11,levels=c("0","1"))
data$crf3a_inv_cardiac___1 = factor(data$crf3a_inv_cardiac___1,levels=c("0","1"))
data$crf3a_inv_cardiac___2 = factor(data$crf3a_inv_cardiac___2,levels=c("0","1"))
data$crf3a_inv_cardiac___3 = factor(data$crf3a_inv_cardiac___3,levels=c("0","1"))
data$crf3a_inv_cardiac___4 = factor(data$crf3a_inv_cardiac___4,levels=c("0","1"))
data$crf3a_inv_cardiac___5 = factor(data$crf3a_inv_cardiac___5,levels=c("0","1"))
data$crf3a_inv_cardiac___6 = factor(data$crf3a_inv_cardiac___6,levels=c("0","1"))
data$crf3a_inv_haema___1 = factor(data$crf3a_inv_haema___1,levels=c("0","1"))
data$crf3a_inv_haema___2 = factor(data$crf3a_inv_haema___2,levels=c("0","1"))
data$crf3a_inv_haema___3 = factor(data$crf3a_inv_haema___3,levels=c("0","1"))
data$crf3a_link_add_blood_haema = factor(data$crf3a_link_add_blood_haema,levels=c("1","0"))
data$crf3a_inv_renal___1 = factor(data$crf3a_inv_renal___1,levels=c("0","1"))
data$crf3a_inv_renal___2 = factor(data$crf3a_inv_renal___2,levels=c("0","1"))
data$crf3a_inv_renal___3 = factor(data$crf3a_inv_renal___3,levels=c("0","1"))
data$crf3a_inv_renal___4 = factor(data$crf3a_inv_renal___4,levels=c("0","1"))
data$crf3a_inv_renal___5 = factor(data$crf3a_inv_renal___5,levels=c("0","1"))
data$crf3a_inv_renal___6 = factor(data$crf3a_inv_renal___6,levels=c("0","1"))
data$crf3a_inv_renal___7 = factor(data$crf3a_inv_renal___7,levels=c("0","1"))
data$crf3a_link_blood_urine = factor(data$crf3a_link_blood_urine,levels=c("1","0"))
data$crf3a_inv_immu___1 = factor(data$crf3a_inv_immu___1,levels=c("0","1"))
data$crf3a_inv_immu___2 = factor(data$crf3a_inv_immu___2,levels=c("0","1"))
data$crf3a_inv_immu___3 = factor(data$crf3a_inv_immu___3,levels=c("0","1"))
data$crf3a_inv_immu___4 = factor(data$crf3a_inv_immu___4,levels=c("0","1"))
data$crf3a_link_blood_immun = factor(data$crf3a_link_blood_immun,levels=c("1","0"))
data$crf3a_inv_neuro___1 = factor(data$crf3a_inv_neuro___1,levels=c("0","1"))
data$crf3a_inv_neuro___2 = factor(data$crf3a_inv_neuro___2,levels=c("0","1"))
data$crf3a_inv_neuro___3 = factor(data$crf3a_inv_neuro___3,levels=c("0","1"))
data$crf3a_inv_neuro___4 = factor(data$crf3a_inv_neuro___4,levels=c("0","1"))
data$crf3a_inv_neuro___5 = factor(data$crf3a_inv_neuro___5,levels=c("0","1"))
data$crf3a_inv_neuro___6 = factor(data$crf3a_inv_neuro___6,levels=c("0","1"))
data$crf3a_quest___1 = factor(data$crf3a_quest___1,levels=c("0","1"))
data$crf3a_quest___2 = factor(data$crf3a_quest___2,levels=c("0","1"))
data$crf3a_quest___3 = factor(data$crf3a_quest___3,levels=c("0","1"))
data$crf3a_quest___4 = factor(data$crf3a_quest___4,levels=c("0","1"))
data$crf3a_quest___5 = factor(data$crf3a_quest___5,levels=c("0","1"))
data$crf3a_quest___6 = factor(data$crf3a_quest___6,levels=c("0","1"))
data$crf3a_quest___7 = factor(data$crf3a_quest___7,levels=c("0","1"))
data$crf3a_quest___8 = factor(data$crf3a_quest___8,levels=c("0","1"))
data$crf3a_quest___9 = factor(data$crf3a_quest___9,levels=c("0","1"))
data$crf3a_quest___10 = factor(data$crf3a_quest___10,levels=c("0","1"))
data$crf3a_quest___11 = factor(data$crf3a_quest___11,levels=c("0","1"))
data$crf3a_quest_mrc = factor(data$crf3a_quest_mrc,levels=c("1","0"))
data$crf3a_quest_eq5d5l = factor(data$crf3a_quest_eq5d5l,levels=c("1","0"))
data$crf3a_quest_gad7 = factor(data$crf3a_quest_gad7,levels=c("1","0"))
data$crf3a_quest_phq9 = factor(data$crf3a_quest_phq9,levels=c("1","0"))
data$crf3a_quest_sarcf = factor(data$crf3a_quest_sarcf,levels=c("1","0"))
data$crf3a_quest_gppaq = factor(data$crf3a_quest_gppaq,levels=c("1","0"))
data$crf3a_quest_dys12 = factor(data$crf3a_quest_dys12,levels=c("1","0"))
data$crf3a_quest_facit = factor(data$crf3a_quest_facit,levels=c("1","0"))
data$crf3a_quest_bpi = factor(data$crf3a_quest_bpi,levels=c("1","0"))
data$crf3a_quest_pcl5 = factor(data$crf3a_quest_pcl5,levels=c("1","0"))
data$crf3a_quest_neadl = factor(data$crf3a_quest_neadl,levels=c("1","0"))
data$crf3a_inv_quest___1 = factor(data$crf3a_inv_quest___1,levels=c("0","1"))
data$crf3a_inv_quest___2 = factor(data$crf3a_inv_quest___2,levels=c("0","1"))
data$crf3a_quest_moca = factor(data$crf3a_quest_moca,levels=c("1","0"))
data$crf3a_quest_rcfs = factor(data$crf3a_quest_rcfs,levels=c("1","0"))
data$crf3a_pft_done = factor(data$crf3a_pft_done,levels=c("1","0"))
data$crf3a_echo_right = factor(data$crf3a_echo_right,levels=c("1","2","3","4","5"))
data$crf3a_echo_left = factor(data$crf3a_echo_left,levels=c("1","2","3","4","5"))
data$crf3a_tape_done = factor(data$crf3a_tape_done,levels=c("1","0"))
data$crf3a_tape_finding___1 = factor(data$crf3a_tape_finding___1,levels=c("0","1"))
data$crf3a_tape_finding___2 = factor(data$crf3a_tape_finding___2,levels=c("0","1"))
data$crf3a_tape_finding___3 = factor(data$crf3a_tape_finding___3,levels=c("0","1"))
data$crf3a_tape_finding___4 = factor(data$crf3a_tape_finding___4,levels=c("0","1"))
data$crf3a_tape_finding___5 = factor(data$crf3a_tape_finding___5,levels=c("0","1"))
data$crf3a_tape_finding___6 = factor(data$crf3a_tape_finding___6,levels=c("0","1"))
data$crf3a_tape_finding___7 = factor(data$crf3a_tape_finding___7,levels=c("0","1"))
data$crf3a_6mwt_done = factor(data$crf3a_6mwt_done,levels=c("1","0"))
data$crf3a_clinical_data_section_complete = factor(data$crf3a_clinical_data_section_complete,levels=c("0","1","2"))
data$crf3b_version = factor(data$crf3b_version,levels=c("1","2","3","4","5","6","7","8"))
data$crf3b_ongoing_consent_done = factor(data$crf3b_ongoing_consent_done,levels=c("1","0"))
data$crf3b_visit = factor(data$crf3b_visit,levels=c("1","2"))
data$crf3b_hcare_ehv = factor(data$crf3b_hcare_ehv,levels=c("1","0"))
data$crf3b_hcare_pacr = factor(data$crf3b_hcare_pacr,levels=c("1","0"))
data$crf3b_hcare_cgp = factor(data$crf3b_hcare_cgp,levels=c("1","0"))
data$crf3b_hcare_med = factor(data$crf3b_hcare_med,levels=c("1","0"))
data$crf3b_crfev_done = factor(data$crf3b_crfev_done,levels=c("1","0"))
data$crf3b_crf4_done = factor(data$crf3b_crf4_done,levels=c("1","0"))
data$crf3b_medlog_done = factor(data$crf3b_medlog_done,levels=c("1","0"))
data$crf3b_eq5d_done = factor(data$crf3b_eq5d_done,levels=c("1","0"))
data$crf3b_mrc_done = factor(data$crf3b_mrc_done,levels=c("1","0"))
data$crf3b_social_history_done = factor(data$crf3b_social_history_done,levels=c("1","0"))
data$crf3b_new_prob = factor(data$crf3b_new_prob,levels=c("1","0"))
data$crf3b_spost_livewell = factor(data$crf3b_spost_livewell,levels=c("1","0","2"))
data$crf3b_spost_iapt = factor(data$crf3b_spost_iapt,levels=c("1","0","2"))
data$crf3b_spost_shyg = factor(data$crf3b_spost_shyg,levels=c("1","0","2"))
data$crf3b_spost_mental = factor(data$crf3b_spost_mental,levels=c("1","0","2"))
data$crf3b_spost_drinkfree = factor(data$crf3b_spost_drinkfree,levels=c("1","0","2"))
data$crf3b_spost_phyinac = factor(data$crf3b_spost_phyinac,levels=c("1","0","2"))
data$crf3b_spost_smkadv = factor(data$crf3b_spost_smkadv,levels=c("1","0","2"))
data$crf3b_spost_smkref = factor(data$crf3b_spost_smkref,levels=c("1","0","2"))
data$crf3b_spost_smkapp = factor(data$crf3b_spost_smkapp,levels=c("1","0","2"))
data$crf3b_spost_wmgmt = factor(data$crf3b_spost_wmgmt,levels=c("1","0","2"))
data$crf3b_spost_heat = factor(data$crf3b_spost_heat,levels=c("1","0","2"))
data$crf3b_inv_assess___1 = factor(data$crf3b_inv_assess___1,levels=c("0","1"))
data$crf3b_inv_assess___2 = factor(data$crf3b_inv_assess___2,levels=c("0","1"))
data$crf3b_inv_assess___3 = factor(data$crf3b_inv_assess___3,levels=c("0","1"))
data$crf3b_assess_moca = factor(data$crf3b_assess_moca,levels=c("1","0"))
data$crf3b_assess_cfs = factor(data$crf3b_assess_cfs,levels=c("1","0"))
data$crf3b_truecolours_check = factor(data$crf3b_truecolours_check,levels=c("1","0"))
data$crf3b_quests___1 = factor(data$crf3b_quests___1,levels=c("0","1"))
data$crf3b_quests___2 = factor(data$crf3b_quests___2,levels=c("0","1"))
data$crf3b_quests___3 = factor(data$crf3b_quests___3,levels=c("0","1"))
data$crf3b_quests___4 = factor(data$crf3b_quests___4,levels=c("0","1"))
data$crf3b_quests___5 = factor(data$crf3b_quests___5,levels=c("0","1"))
data$crf3b_quests___6 = factor(data$crf3b_quests___6,levels=c("0","1"))
data$crf3b_quests___7 = factor(data$crf3b_quests___7,levels=c("0","1"))
data$crf3b_quests___8 = factor(data$crf3b_quests___8,levels=c("0","1"))
data$crf3b_quests___9 = factor(data$crf3b_quests___9,levels=c("0","1"))
data$crf3b_quests___10 = factor(data$crf3b_quests___10,levels=c("0","1"))
data$crf3b_quests___11 = factor(data$crf3b_quests___11,levels=c("0","1"))
data$crf3b_quest_mrc = factor(data$crf3b_quest_mrc,levels=c("1","0"))
data$crf3b_quest_eq5d5l = factor(data$crf3b_quest_eq5d5l,levels=c("1","0"))
data$crf3b_quest_gad7 = factor(data$crf3b_quest_gad7,levels=c("1","0"))
data$crf3b_quest_phq9 = factor(data$crf3b_quest_phq9,levels=c("1","0"))
data$crf3b_quest_sarcf = factor(data$crf3b_quest_sarcf,levels=c("1","0"))
data$crf3b_quest_gppaq = factor(data$crf3b_quest_gppaq,levels=c("1","0"))
data$crf3b_quest_dys12 = factor(data$crf3b_quest_dys12,levels=c("1","0"))
data$crf3b_quest_facit = factor(data$crf3b_quest_facit,levels=c("1","0"))
data$crf3b_quest_bpi = factor(data$crf3b_quest_bpi,levels=c("1","0"))
data$crf3b_quest_pcl5 = factor(data$crf3b_quest_pcl5,levels=c("1","0"))
data$crf3b_quest_neadl = factor(data$crf3b_quest_neadl,levels=c("1","0"))
data$crf3b_fried_shrink = factor(data$crf3b_fried_shrink,levels=c("1","0"))
data$crf3b_fried_energy = factor(data$crf3b_fried_energy,levels=c("1","0"))
data$crf3b_fried_rest_day = factor(data$crf3b_fried_rest_day,levels=c("1","2","3","4"))
data$crf3b_t2_core = factor(data$crf3b_t2_core,levels=c("1","0"))
data$crf3b_t2_research = factor(data$crf3b_t2_research,levels=c("1","0"))
data$crf3b_pft = factor(data$crf3b_pft,levels=c("1","0"))
data$crf3b_qrisk3 = factor(data$crf3b_qrisk3,levels=c("1","0"))
data$cr3b_waist_done = factor(data$cr3b_waist_done,levels=c("1","0"))
data$crf3b_bodycom_bia = factor(data$crf3b_bodycom_bia,levels=c("1","0"))
data$crf3b_bodycom_dxa = factor(data$crf3b_bodycom_dxa,levels=c("1","0"))
data$crf3b_muscle_strength = factor(data$crf3b_muscle_strength,levels=c("1","0"))
data$crf3b_iswt_1 = factor(data$crf3b_iswt_1,levels=c("1","0"))
data$crf3b_iswt_2 = factor(data$crf3b_iswt_2,levels=c("1","0"))
data$crf3b_sppb = factor(data$crf3b_sppb,levels=c("1","0"))
data$crf3b_amc_inform = factor(data$crf3b_amc_inform,levels=c("1","0"))
data$crf3b_amc_happy = factor(data$crf3b_amc_happy,levels=c("1","0"))
data$crf3b_amc_location = factor(data$crf3b_amc_location,levels=c("1","2"))
data$crf3b_amc_strap = factor(data$crf3b_amc_strap,levels=c("1","2"))
data$crf3b_future_studies = factor(data$crf3b_future_studies,levels=c("1","0"))
data$crf3b_research_data_section_complete = factor(data$crf3b_research_data_section_complete,levels=c("0","1","2"))
data$crf3c_version = factor(data$crf3c_version,levels=c("1","2","3","4","5","6","7","8"))
data$crf3c_psqi = factor(data$crf3c_psqi,levels=c("1","0"))
data$crf3c_meq = factor(data$crf3c_meq,levels=c("1","0"))
data$crf3c_lcq = factor(data$crf3c_lcq,levels=c("1","0"))
data$crf3c_other_quest = factor(data$crf3c_other_quest,levels=c("1","0"))
data$crf3c_t3_qmus = factor(data$crf3c_t3_qmus,levels=c("1","0"))
data$crf3c_t3_mb = factor(data$crf3c_t3_mb,levels=c("1","0"))
data$crf3c_t3_bs = factor(data$crf3c_t3_bs,levels=c("1","0"))
data$crf3c_t3_genomicc = factor(data$crf3c_t3_genomicc,levels=c("1","0"))
data$crf3c_t3_lir_turtle = factor(data$crf3c_t3_lir_turtle,levels=c("1","0"))
data$crf3c_t3_other = factor(data$crf3c_t3_other,levels=c("1","0"))
data$crf3c_genomicc_consent = factor(data$crf3c_genomicc_consent,levels=c("1"))
data$crf3c_genomicc_withdrawal___1 = factor(data$crf3c_genomicc_withdrawal___1,levels=c("0","1"))
data$crf3c_genomicc_withdrawal___2 = factor(data$crf3c_genomicc_withdrawal___2,levels=c("0","1"))
data$crf3c_additional_research_procedures_complete = factor(data$crf3c_additional_research_procedures_complete,levels=c("0","1","2"))
data$crf4a_version = factor(data$crf4a_version,levels=c("1","2","3","4","5","6","7"))
data$crf4a_rest_spo2_done = factor(data$crf4a_rest_spo2_done,levels=c("1","0"))
data$crf4a_rest_hr_done = factor(data$crf4a_rest_hr_done,levels=c("1","0"))
data$crf4a_rest_bp_done = factor(data$crf4a_rest_bp_done,levels=c("1","0"))
data$crf4a_rest_temp_done = factor(data$crf4a_rest_temp_done,levels=c("1","0"))
data$crf4a_rest_height_done = factor(data$crf4a_rest_height_done,levels=c("1","0"))
data$crf4a_rest_weight_done = factor(data$crf4a_rest_weight_done,levels=c("1","0"))
data$crf4a_base_cxr_done = factor(data$crf4a_base_cxr_done,levels=c("1","2"))
data$crf4a_base_ecg_done = factor(data$crf4a_base_ecg_done,levels=c("1","2"))
data$crf4a_base_cxr = factor(data$crf4a_base_cxr,levels=c("1","2","3","4","5"))
data$crf4a_ecg = factor(data$crf4a_ecg,levels=c("1","2","3","4","5"))
data$crf4a_outcome_fup = factor(data$crf4a_outcome_fup,levels=c("1","0"))
data$crf4a_outcome_ras = factor(data$crf4a_outcome_ras,levels=c("1","0"))
data$crf4a_outcome_rtc = factor(data$crf4a_outcome_rtc,levels=c("1","0"))
data$crf4a_outcome_rpc = factor(data$crf4a_outcome_rpc,levels=c("1","0"))
data$crf4a_outcome_rmhs = factor(data$crf4a_outcome_rmhs,levels=c("1","0"))
data$crf4a_outcome_rrh = factor(data$crf4a_outcome_rrh,levels=c("1","0"))
data$crf4a_outcome_rdt = factor(data$crf4a_outcome_rdt,levels=c("1","0"))
data$crf4a_outcome_rsss = factor(data$crf4a_outcome_rsss,levels=c("1","0"))
data$crf4a_outcome_dis = factor(data$crf4a_outcome_dis,levels=c("1","0"))
data$crf4a_tier = factor(data$crf4a_tier,levels=c("1","2"))
data$crf4a_blood_done = factor(data$crf4a_blood_done,levels=c("1","0"))
data$crf4a_blood_fbc = factor(data$crf4a_blood_fbc,levels=c("1","0"))
data$crf4a_blood_ue = factor(data$crf4a_blood_ue,levels=c("1","0"))
data$crf4a_blood_egfr = factor(data$crf4a_blood_egfr,levels=c("1","0"))
data$crf4a_blood_lfts = factor(data$crf4a_blood_lfts,levels=c("1","0"))
data$crf4a_blood_crp = factor(data$crf4a_blood_crp,levels=c("1","0"))
data$crf4a_blood_bp = factor(data$crf4a_blood_bp,levels=c("1","0"))
data$crf4a_blood_25oh = factor(data$crf4a_blood_25oh,levels=c("1","0"))
data$crf4a_blood_bnp = factor(data$crf4a_blood_bnp,levels=c("1","0"))
data$crf4a_blood_trop = factor(data$crf4a_blood_trop,levels=c("1","0"))
data$crf4a_blood_ddim = factor(data$crf4a_blood_ddim,levels=c("1","0"))
data$crf4a_blood_fib = factor(data$crf4a_blood_fib,levels=c("1","0"))
data$crf4a_blood_inr = factor(data$crf4a_blood_inr,levels=c("1","0"))
data$crf4a_blood_fer = factor(data$crf4a_blood_fer,levels=c("1","0"))
data$crf4a_blood_hba1c = factor(data$crf4a_blood_hba1c,levels=c("1","0"))
data$crf4a_blood_lp = factor(data$crf4a_blood_lp,levels=c("1","0"))
data$crf4a_blood_covid19 = factor(data$crf4a_blood_covid19,levels=c("1","0"))
data$crf4a_link_routine_blood = factor(data$crf4a_link_routine_blood,levels=c("1","0"))
data$crf4a_link_add_blood_sars = factor(data$crf4a_link_add_blood_sars,levels=c("1","0"))
data$crf4a_inv_resp___1 = factor(data$crf4a_inv_resp___1,levels=c("0","1"))
data$crf4a_inv_resp___2 = factor(data$crf4a_inv_resp___2,levels=c("0","1"))
data$crf4a_inv_resp___3 = factor(data$crf4a_inv_resp___3,levels=c("0","1"))
data$crf4a_inv_resp___4 = factor(data$crf4a_inv_resp___4,levels=c("0","1"))
data$crf4a_inv_resp___5 = factor(data$crf4a_inv_resp___5,levels=c("0","1"))
data$crf4a_inv_resp___6 = factor(data$crf4a_inv_resp___6,levels=c("0","1"))
data$crf4a_inv_resp___7 = factor(data$crf4a_inv_resp___7,levels=c("0","1"))
data$crf4a_inv_resp___8 = factor(data$crf4a_inv_resp___8,levels=c("0","1"))
data$crf4a_inv_resp___9 = factor(data$crf4a_inv_resp___9,levels=c("0","1"))
data$crf4a_inv_resp___10 = factor(data$crf4a_inv_resp___10,levels=c("0","1"))
data$crf4a_inv_resp___11 = factor(data$crf4a_inv_resp___11,levels=c("0","1"))
data$crf4a_inv_cardiac___1 = factor(data$crf4a_inv_cardiac___1,levels=c("0","1"))
data$crf4a_inv_cardiac___2 = factor(data$crf4a_inv_cardiac___2,levels=c("0","1"))
data$crf4a_inv_cardiac___3 = factor(data$crf4a_inv_cardiac___3,levels=c("0","1"))
data$crf4a_inv_cardiac___4 = factor(data$crf4a_inv_cardiac___4,levels=c("0","1"))
data$crf4a_inv_cardiac___5 = factor(data$crf4a_inv_cardiac___5,levels=c("0","1"))
data$crf4a_inv_cardiac___6 = factor(data$crf4a_inv_cardiac___6,levels=c("0","1"))
data$crf4a_inv_haema___1 = factor(data$crf4a_inv_haema___1,levels=c("0","1"))
data$crf4a_inv_haema___2 = factor(data$crf4a_inv_haema___2,levels=c("0","1"))
data$crf4a_inv_haema___3 = factor(data$crf4a_inv_haema___3,levels=c("0","1"))
data$crf4a_link_add_blood_haema = factor(data$crf4a_link_add_blood_haema,levels=c("1","0"))
data$crf4a_inv_renal___1 = factor(data$crf4a_inv_renal___1,levels=c("0","1"))
data$crf4a_inv_renal___2 = factor(data$crf4a_inv_renal___2,levels=c("0","1"))
data$crf4a_inv_renal___3 = factor(data$crf4a_inv_renal___3,levels=c("0","1"))
data$crf4a_inv_renal___4 = factor(data$crf4a_inv_renal___4,levels=c("0","1"))
data$crf4a_inv_renal___5 = factor(data$crf4a_inv_renal___5,levels=c("0","1"))
data$crf4a_inv_renal___6 = factor(data$crf4a_inv_renal___6,levels=c("0","1"))
data$crf4a_inv_renal___7 = factor(data$crf4a_inv_renal___7,levels=c("0","1"))
data$crf4a_link_blood_urine = factor(data$crf4a_link_blood_urine,levels=c("1","0"))
data$crf4a_inv_immu___1 = factor(data$crf4a_inv_immu___1,levels=c("0","1"))
data$crf4a_inv_immu___2 = factor(data$crf4a_inv_immu___2,levels=c("0","1"))
data$crf4a_inv_immu___3 = factor(data$crf4a_inv_immu___3,levels=c("0","1"))
data$crf4a_inv_immu___4 = factor(data$crf4a_inv_immu___4,levels=c("0","1"))
data$crf4a_link_blood_immun = factor(data$crf4a_link_blood_immun,levels=c("1","0"))
data$crf4a_inv_neuro___1 = factor(data$crf4a_inv_neuro___1,levels=c("0","1"))
data$crf4a_inv_neuro___2 = factor(data$crf4a_inv_neuro___2,levels=c("0","1"))
data$crf4a_inv_neuro___3 = factor(data$crf4a_inv_neuro___3,levels=c("0","1"))
data$crf4a_inv_neuro___4 = factor(data$crf4a_inv_neuro___4,levels=c("0","1"))
data$crf4a_inv_neuro___5 = factor(data$crf4a_inv_neuro___5,levels=c("0","1"))
data$crf4a_inv_neuro___6 = factor(data$crf4a_inv_neuro___6,levels=c("0","1"))
data$crf4a_quest___1 = factor(data$crf4a_quest___1,levels=c("0","1"))
data$crf4a_quest___2 = factor(data$crf4a_quest___2,levels=c("0","1"))
data$crf4a_quest___3 = factor(data$crf4a_quest___3,levels=c("0","1"))
data$crf4a_quest___4 = factor(data$crf4a_quest___4,levels=c("0","1"))
data$crf4a_quest___5 = factor(data$crf4a_quest___5,levels=c("0","1"))
data$crf4a_quest___6 = factor(data$crf4a_quest___6,levels=c("0","1"))
data$crf4a_quest___7 = factor(data$crf4a_quest___7,levels=c("0","1"))
data$crf4a_quest___8 = factor(data$crf4a_quest___8,levels=c("0","1"))
data$crf4a_quest___9 = factor(data$crf4a_quest___9,levels=c("0","1"))
data$crf4a_quest___10 = factor(data$crf4a_quest___10,levels=c("0","1"))
data$crf4a_quest___11 = factor(data$crf4a_quest___11,levels=c("0","1"))
data$crf4a_quest_mrc = factor(data$crf4a_quest_mrc,levels=c("1","0"))
data$crf4a_quest_eq5d5l = factor(data$crf4a_quest_eq5d5l,levels=c("1","0"))
data$crf4a_quest_gad7 = factor(data$crf4a_quest_gad7,levels=c("1","0"))
data$crf4a_quest_phq9 = factor(data$crf4a_quest_phq9,levels=c("1","0"))
data$crf4a_quest_sarcf = factor(data$crf4a_quest_sarcf,levels=c("1","0"))
data$crf4a_quest_gppaq = factor(data$crf4a_quest_gppaq,levels=c("1","0"))
data$crf4a_quest_dys12 = factor(data$crf4a_quest_dys12,levels=c("1","0"))
data$crf4a_quest_facit = factor(data$crf4a_quest_facit,levels=c("1","0"))
data$crf4a_quest_bpi = factor(data$crf4a_quest_bpi,levels=c("1","0"))
data$crf4a_quest_pcl5 = factor(data$crf4a_quest_pcl5,levels=c("1","0"))
data$crf4a_quest_neadl = factor(data$crf4a_quest_neadl,levels=c("1","0"))
data$crf4a_inv_quest___1 = factor(data$crf4a_inv_quest___1,levels=c("0","1"))
data$crf4a_inv_quest___2 = factor(data$crf4a_inv_quest___2,levels=c("0","1"))
data$crf4a_quest_moca = factor(data$crf4a_quest_moca,levels=c("1","0"))
data$crf4a_quest_rcfs = factor(data$crf4a_quest_rcfs,levels=c("1","0"))
data$crf4a_pft_done = factor(data$crf4a_pft_done,levels=c("1","0"))
data$crf4a_echo_right = factor(data$crf4a_echo_right,levels=c("1","2","3","4","5"))
data$crf4a_echo_left = factor(data$crf4a_echo_left,levels=c("1","2","3","4","5"))
data$crf4a_tape_done = factor(data$crf4a_tape_done,levels=c("1","0"))
data$crf4a_tape_finding___1 = factor(data$crf4a_tape_finding___1,levels=c("0","1"))
data$crf4a_tape_finding___2 = factor(data$crf4a_tape_finding___2,levels=c("0","1"))
data$crf4a_tape_finding___3 = factor(data$crf4a_tape_finding___3,levels=c("0","1"))
data$crf4a_tape_finding___4 = factor(data$crf4a_tape_finding___4,levels=c("0","1"))
data$crf4a_tape_finding___5 = factor(data$crf4a_tape_finding___5,levels=c("0","1"))
data$crf4a_tape_finding___6 = factor(data$crf4a_tape_finding___6,levels=c("0","1"))
data$crf4a_tape_finding___7 = factor(data$crf4a_tape_finding___7,levels=c("0","1"))
data$crf4a_6mwt_done = factor(data$crf4a_6mwt_done,levels=c("1","0"))
data$crf4a_clinical_data_section_complete = factor(data$crf4a_clinical_data_section_complete,levels=c("0","1","2"))
data$crf4b_version = factor(data$crf4b_version,levels=c("1","2","3","4","5","6","7"))
data$crf4b_ongoing_confirmed = factor(data$crf4b_ongoing_confirmed,levels=c("1","0"))
data$crf4b_tier2_blood = factor(data$crf4b_tier2_blood,levels=c("1","0"))
data$crf4b_research_data_section_complete = factor(data$crf4b_research_data_section_complete,levels=c("0","1","2"))
data$crf_emergency_version = factor(data$crf_emergency_version,levels=c("1","2","3"))
data$crfev_symptoms___1 = factor(data$crfev_symptoms___1,levels=c("0","1"))
data$crfev_symptoms___2 = factor(data$crfev_symptoms___2,levels=c("0","1"))
data$crfev_symptoms___3 = factor(data$crfev_symptoms___3,levels=c("0","1"))
data$crfev_symptoms___4 = factor(data$crfev_symptoms___4,levels=c("0","1"))
data$crfev_symptoms___5 = factor(data$crfev_symptoms___5,levels=c("0","1"))
data$crfev_symptoms___6 = factor(data$crfev_symptoms___6,levels=c("0","1"))
data$crfev_symptoms___7 = factor(data$crfev_symptoms___7,levels=c("0","1"))
data$crfev_symptoms___8 = factor(data$crfev_symptoms___8,levels=c("0","1"))
data$crfev_symptoms___9 = factor(data$crfev_symptoms___9,levels=c("0","1"))
data$crfev_symptoms___10 = factor(data$crfev_symptoms___10,levels=c("0","1"))
data$crfev_symptoms___11 = factor(data$crfev_symptoms___11,levels=c("0","1"))
data$crfev_symptoms___12 = factor(data$crfev_symptoms___12,levels=c("0","1"))
data$crfev_symptoms___13 = factor(data$crfev_symptoms___13,levels=c("0","1"))
data$crfev_symptoms___14 = factor(data$crfev_symptoms___14,levels=c("0","1"))
data$crfev_symptoms___15 = factor(data$crfev_symptoms___15,levels=c("0","1"))
data$crfev_symptoms___16 = factor(data$crfev_symptoms___16,levels=c("0","1"))
data$crfev_itu_hdu_adm = factor(data$crfev_itu_hdu_adm,levels=c("1","0","2"))
data$crfev_med_change = factor(data$crfev_med_change,levels=c("1","0","2"))
data$crfev_dis_diagnosis___1 = factor(data$crfev_dis_diagnosis___1,levels=c("0","1"))
data$crfev_dis_diagnosis___2 = factor(data$crfev_dis_diagnosis___2,levels=c("0","1"))
data$crfev_cxr_done = factor(data$crfev_cxr_done,levels=c("1","0"))
data$crfev_ecg_done = factor(data$crfev_ecg_done,levels=c("1","0"))
data$crfev_xr_result___1 = factor(data$crfev_xr_result___1,levels=c("0","1"))
data$crfev_xr_result___2 = factor(data$crfev_xr_result___2,levels=c("0","1"))
data$crfev_xr_result___3 = factor(data$crfev_xr_result___3,levels=c("0","1"))
data$crfev_xr_result___4 = factor(data$crfev_xr_result___4,levels=c("0","1"))
data$crfev_xr_result___5 = factor(data$crfev_xr_result___5,levels=c("0","1"))
data$crfev_ecg_result___1 = factor(data$crfev_ecg_result___1,levels=c("0","1"))
data$crfev_ecg_result___2 = factor(data$crfev_ecg_result___2,levels=c("0","1"))
data$crfev_ecg_result___3 = factor(data$crfev_ecg_result___3,levels=c("0","1"))
data$crfev_ecg_result___4 = factor(data$crfev_ecg_result___4,levels=c("0","1"))
data$crfev_ecg_result___5 = factor(data$crfev_ecg_result___5,levels=c("0","1"))
data$crfev_blood_done = factor(data$crfev_blood_done,levels=c("1","0","2"))
data$crfev_other_inv_done = factor(data$crfev_other_inv_done,levels=c("1","0","2"))
data$crfev_blood_desc = factor(data$crfev_blood_desc,levels=c("1","0"))
data$crfev_add_inv_resp___1 = factor(data$crfev_add_inv_resp___1,levels=c("0","1"))
data$crfev_add_inv_resp___2 = factor(data$crfev_add_inv_resp___2,levels=c("0","1"))
data$crfev_add_inv_resp___3 = factor(data$crfev_add_inv_resp___3,levels=c("0","1"))
data$crfev_add_inv_resp___4 = factor(data$crfev_add_inv_resp___4,levels=c("0","1"))
data$crfev_add_inv_resp___5 = factor(data$crfev_add_inv_resp___5,levels=c("0","1"))
data$crfev_add_inv_resp___6 = factor(data$crfev_add_inv_resp___6,levels=c("0","1"))
data$crfev_add_inv_resp___7 = factor(data$crfev_add_inv_resp___7,levels=c("0","1"))
data$crfev_add_inv_resp___8 = factor(data$crfev_add_inv_resp___8,levels=c("0","1"))
data$crfev_add_inv_resp___9 = factor(data$crfev_add_inv_resp___9,levels=c("0","1"))
data$crfev_add_inv_resp___10 = factor(data$crfev_add_inv_resp___10,levels=c("0","1"))
data$crfev_add_inv_resp___11 = factor(data$crfev_add_inv_resp___11,levels=c("0","1"))
data$crfev_add_inv_card___1 = factor(data$crfev_add_inv_card___1,levels=c("0","1"))
data$crfev_add_inv_card___2 = factor(data$crfev_add_inv_card___2,levels=c("0","1"))
data$crfev_add_inv_card___3 = factor(data$crfev_add_inv_card___3,levels=c("0","1"))
data$crfev_add_inv_card___4 = factor(data$crfev_add_inv_card___4,levels=c("0","1"))
data$crfev_add_inv_card___5 = factor(data$crfev_add_inv_card___5,levels=c("0","1"))
data$crfev_add_inv_card___6 = factor(data$crfev_add_inv_card___6,levels=c("0","1"))
data$crfev_add_inv_haema___1 = factor(data$crfev_add_inv_haema___1,levels=c("0","1"))
data$crfev_add_inv_haema___2 = factor(data$crfev_add_inv_haema___2,levels=c("0","1"))
data$crfev_add_inv_haema___3 = factor(data$crfev_add_inv_haema___3,levels=c("0","1"))
data$crfev_link_add_blood_haema = factor(data$crfev_link_add_blood_haema,levels=c("1","0"))
data$crfev_add_inv_renal___1 = factor(data$crfev_add_inv_renal___1,levels=c("0","1"))
data$crfev_add_inv_renal___2 = factor(data$crfev_add_inv_renal___2,levels=c("0","1"))
data$crfev_add_inv_renal___3 = factor(data$crfev_add_inv_renal___3,levels=c("0","1"))
data$crfev_add_inv_renal___4 = factor(data$crfev_add_inv_renal___4,levels=c("0","1"))
data$crfev_add_inv_renal___5 = factor(data$crfev_add_inv_renal___5,levels=c("0","1"))
data$crfev_add_inv_renal___6 = factor(data$crfev_add_inv_renal___6,levels=c("0","1"))
data$crfev_add_inv_renal___7 = factor(data$crfev_add_inv_renal___7,levels=c("0","1"))
data$crfev_link_blood_urine = factor(data$crfev_link_blood_urine,levels=c("1","0"))
data$crfev_add_inv_immu___1 = factor(data$crfev_add_inv_immu___1,levels=c("0","1"))
data$crfev_add_inv_immu___2 = factor(data$crfev_add_inv_immu___2,levels=c("0","1"))
data$crfev_add_inv_immu___3 = factor(data$crfev_add_inv_immu___3,levels=c("0","1"))
data$crfev_add_inv_immu___4 = factor(data$crfev_add_inv_immu___4,levels=c("0","1"))
data$crfev_link_blood_immun = factor(data$crfev_link_blood_immun,levels=c("1","0"))
data$crfev_add_inv_neuro___1 = factor(data$crfev_add_inv_neuro___1,levels=c("0","1"))
data$crfev_add_inv_neuro___2 = factor(data$crfev_add_inv_neuro___2,levels=c("0","1"))
data$crfev_add_inv_neuro___3 = factor(data$crfev_add_inv_neuro___3,levels=c("0","1"))
data$crfev_add_inv_neuro___4 = factor(data$crfev_add_inv_neuro___4,levels=c("0","1"))
data$crfev_add_inv_neuro___5 = factor(data$crfev_add_inv_neuro___5,levels=c("0","1"))
data$crfev_add_inv_neuro___6 = factor(data$crfev_add_inv_neuro___6,levels=c("0","1"))
data$crfev_add_inv_neuro___7 = factor(data$crfev_add_inv_neuro___7,levels=c("0","1"))
data$crfev_echo_right = factor(data$crfev_echo_right,levels=c("1","2","3","4","5"))
data$crfev_echo_left = factor(data$crfev_echo_left,levels=c("1","2","3","4","5"))
data$crfev_tape_done = factor(data$crfev_tape_done,levels=c("1","0"))
data$crfev_tape_finding___1 = factor(data$crfev_tape_finding___1,levels=c("0","1"))
data$crfev_tape_finding___2 = factor(data$crfev_tape_finding___2,levels=c("0","1"))
data$crfev_tape_finding___3 = factor(data$crfev_tape_finding___3,levels=c("0","1"))
data$crfev_tape_finding___4 = factor(data$crfev_tape_finding___4,levels=c("0","1"))
data$crfev_tape_finding___5 = factor(data$crfev_tape_finding___5,levels=c("0","1"))
data$crfev_tape_finding___6 = factor(data$crfev_tape_finding___6,levels=c("0","1"))
data$crfev_tape_finding___7 = factor(data$crfev_tape_finding___7,levels=c("0","1"))
data$crf_emergency_visit_complete = factor(data$crf_emergency_visit_complete,levels=c("0","1","2"))
data$ae_sae = factor(data$ae_sae,levels=c("1","0"))
data$sae_criteria = factor(data$sae_criteria,levels=c("1","2","3","4","5"))
data$ae_severity = factor(data$ae_severity,levels=c("1","2","3","4"))
data$ae_action = factor(data$ae_action,levels=c("0","1","2","3"))
data$ae_outcome = factor(data$ae_outcome,levels=c("1","2","3","4","5"))
data$adverse_events_log_complete = factor(data$adverse_events_log_complete,levels=c("0","1","2"))
data$wd_type___1 = factor(data$wd_type___1,levels=c("0","1"))
data$wd_type___2 = factor(data$wd_type___2,levels=c("0","1"))
data$wd_sign_type = factor(data$wd_sign_type,levels=c("1","2"))
data$wd_pt_signature_verified = factor(data$wd_pt_signature_verified,levels=c("1","0"))
data$wd_signatory_date_verified = factor(data$wd_signatory_date_verified,levels=c("1","0"))
data$withdrawals_complete = factor(data$withdrawals_complete,levels=c("0","1","2"))
data$crf_early_data_collect_yn = factor(data$crf_early_data_collect_yn,levels=c("1","0"))
data$crf_early_main_reason___1 = factor(data$crf_early_main_reason___1,levels=c("0","1"))
data$crf_early_main_reason___2 = factor(data$crf_early_main_reason___2,levels=c("0","1"))
data$crf_early_main_reason___3 = factor(data$crf_early_main_reason___3,levels=c("0","1"))
data$crf_early_main_reason___4 = factor(data$crf_early_main_reason___4,levels=c("0","1"))
data$crf_early_main_reason___5 = factor(data$crf_early_main_reason___5,levels=c("0","1"))
data$crf_early_main_reason___6 = factor(data$crf_early_main_reason___6,levels=c("0","1"))
data$crf_early_main_reason___7 = factor(data$crf_early_main_reason___7,levels=c("0","1"))
data$crf_early_main_reason___8 = factor(data$crf_early_main_reason___8,levels=c("0","1"))
data$crf_early_main_reason___9 = factor(data$crf_early_main_reason___9,levels=c("0","1"))
data$early_termination_crf_complete = factor(data$early_termination_crf_complete,levels=c("0","1","2"))
data$crf_tier2_data_collect_yn = factor(data$crf_tier2_data_collect_yn,levels=c("1","0"))
data$crf_tier2_main_reason___1 = factor(data$crf_tier2_main_reason___1,levels=c("0","1"))
data$crf_tier2_main_reason___2 = factor(data$crf_tier2_main_reason___2,levels=c("0","1"))
data$crf_tier2_main_reason___3 = factor(data$crf_tier2_main_reason___3,levels=c("0","1"))
data$crf_tier2_main_reason___4 = factor(data$crf_tier2_main_reason___4,levels=c("0","1"))
data$crf_tier2_main_reason___5 = factor(data$crf_tier2_main_reason___5,levels=c("0","1"))
data$crf_tier2_main_reason___6 = factor(data$crf_tier2_main_reason___6,levels=c("0","1"))
data$crf_tier2_main_reason___7 = factor(data$crf_tier2_main_reason___7,levels=c("0","1"))
data$crf_tier2_main_reason___8 = factor(data$crf_tier2_main_reason___8,levels=c("0","1"))
data$crf_tier_2_consent_withdrawal_complete = factor(data$crf_tier_2_consent_withdrawal_complete,levels=c("0","1","2"))
data$med_class = factor(data$med_class,levels=c("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22"))
data$med_frequency = factor(data$med_frequency,levels=c("1","2","3","4","5","6","7","8"))
data$med_route = factor(data$med_route,levels=c("1","2","3","4","5","6","7","8","9","10","11"))
data$repeatable_medications_log_complete = factor(data$repeatable_medications_log_complete,levels=c("0","1","2"))
data$am_wear_location = factor(data$am_wear_location,levels=c("1","2"))
data$am_strap = factor(data$am_strap,levels=c("1","2"))
data$activity_monitor_completion_form_complete = factor(data$activity_monitor_completion_form_complete,levels=c("0","1","2"))
data$mha_ph4_nervous = factor(data$mha_ph4_nervous,levels=c("0","1","2","3"))
data$mha_ph4_worrying = factor(data$mha_ph4_worrying,levels=c("0","1","2","3"))
data$mha_ph4_little_interest = factor(data$mha_ph4_little_interest,levels=c("0","1","2","3"))
data$mha_ph4_depressed = factor(data$mha_ph4_depressed,levels=c("0","1","2","3"))
data$mha_ptsd_memories = factor(data$mha_ptsd_memories,levels=c("1","0"))
data$mha_ptsd_dreams = factor(data$mha_ptsd_dreams,levels=c("1","0"))
data$mha_ptsd_thoughts = factor(data$mha_ptsd_thoughts,levels=c("1","0"))
data$mha_ptsd_memories_detail = factor(data$mha_ptsd_memories_detail,levels=c("1","2","3","4"))
data$mha_ptsd_dreams_detail = factor(data$mha_ptsd_dreams_detail,levels=c("1","2","3","4"))
data$mha_ptsd_thoughts_detail = factor(data$mha_ptsd_thoughts_detail,levels=c("1","2","3","4"))
data$mha_lonely_lack = factor(data$mha_lonely_lack,levels=c("1","2","3"))
data$mha_lonely_left = factor(data$mha_lonely_left,levels=c("1","2","3"))
data$mha_lonely_iso = factor(data$mha_lonely_iso,levels=c("1","2","3"))
data$mha_lonely_lon = factor(data$mha_lonely_lon,levels=c("1","2","3"))
data$repeatable_mental_health_assessment_complete = factor(data$repeatable_mental_health_assessment_complete,levels=c("0","1","2"))
data$nutri_concern_weight = factor(data$nutri_concern_weight,levels=c("1","0"))
data$nutri_appetite = factor(data$nutri_appetite,levels=c("0","1","2","3","4","5"))
data$nutri_advice = factor(data$nutri_advice,levels=c("1","0"))
data$repeatable_nutrition_complete = factor(data$repeatable_nutrition_complete,levels=c("0","1","2"))
data$social_status_before = factor(data$social_status_before,levels=c("1","2","3","4","5","6","7","8","9"))
data$social_employ_pre_mar20 = factor(data$social_employ_pre_mar20,levels=c("1","2","3","4","5","6","7","8","9"))
data$social_employ_pre_covid = factor(data$social_employ_pre_covid,levels=c("1","2","3","4","5","6","7","8","9","10","11"))
data$social_employ_post_covid = factor(data$social_employ_post_covid,levels=c("1","2","3","4","5","6","7","8","9","10","11"))
data$social_shift_work = factor(data$social_shift_work,levels=c("0","1","2","3","4","5"))
data$social_shift_night = factor(data$social_shift_night,levels=c("0","1","2","3","4","5"))
data$social_affect_work = factor(data$social_affect_work,levels=c("1","0"))
data$social_exp_bereave = factor(data$social_exp_bereave,levels=c("1","0"))
data$repeatable_social_history_complete = factor(data$repeatable_social_history_complete,levels=c("0","1","2"))
data$hp_today_seeing = factor(data$hp_today_seeing,levels=c("0","1","2","3"))
data$hp_today_hearing = factor(data$hp_today_hearing,levels=c("0","1","2","3"))
data$hp_today_walking = factor(data$hp_today_walking,levels=c("0","1","2","3"))
data$hp_today_remembering = factor(data$hp_today_remembering,levels=c("0","1","2","3"))
data$hp_today_self_care = factor(data$hp_today_self_care,levels=c("0","1","2","3"))
data$hp_today_communicating = factor(data$hp_today_communicating,levels=c("0","1","2","3"))
data$hp_precovid_seeing = factor(data$hp_precovid_seeing,levels=c("0","1","2","3"))
data$hp_precovid_hearing = factor(data$hp_precovid_hearing,levels=c("0","1","2","3"))
data$hp_precovid_walking = factor(data$hp_precovid_walking,levels=c("0","1","2","3"))
data$hp_precovid_remebering = factor(data$hp_precovid_remebering,levels=c("0","1","2","3"))
data$hp_precovid_self_care = factor(data$hp_precovid_self_care,levels=c("0","1","2","3"))
data$hp_precovid_communicating = factor(data$hp_precovid_communicating,levels=c("0","1","2","3"))
data$repeatable_activity_difficulties_from_health_probl_complete = factor(data$repeatable_activity_difficulties_from_health_probl_complete,levels=c("0","1","2"))
data$ls_smoke = factor(data$ls_smoke,levels=c("0","1","2"))
data$ls_smoke_e = factor(data$ls_smoke_e,levels=c("1","0"))
data$ls_change_smoke = factor(data$ls_change_smoke,levels=c("1","2","3","4"))
data$ls_change_drink = factor(data$ls_change_drink,levels=c("1","2","3","4"))
data$ls_change_food = factor(data$ls_change_food,levels=c("1","2","3","4"))
data$ls_change_activity = factor(data$ls_change_activity,levels=c("1","2","3","4"))
data$repeatable_lifestyle_complete = factor(data$repeatable_lifestyle_complete,levels=c("0","1","2"))
data$eq5d_done = factor(data$eq5d_done,levels=c("1","0"))
data$eq5d_timepoints = factor(data$eq5d_timepoints,levels=c("1","2","3"))
data$eq5d5l_q1_pre = factor(data$eq5d5l_q1_pre,levels=c("1","2","3","4","5"))
data$eq5d5l_q2_pre = factor(data$eq5d5l_q2_pre,levels=c("1","2","3","4","5"))
data$eq5d5l_q3_pre = factor(data$eq5d5l_q3_pre,levels=c("1","2","3","4","5"))
data$eq5d5l_q4_pre = factor(data$eq5d5l_q4_pre,levels=c("1","2","3","4","5"))
data$eq5d5l_q5_pre = factor(data$eq5d5l_q5_pre,levels=c("1","2","3","4","5"))
data$eq5d5l_q1 = factor(data$eq5d5l_q1,levels=c("1","2","3","4","5"))
data$eq5d5l_q2 = factor(data$eq5d5l_q2,levels=c("1","2","3","4","5"))
data$eq5d5l_q3 = factor(data$eq5d5l_q3,levels=c("1","2","3","4","5"))
data$eq5d5l_q4 = factor(data$eq5d5l_q4,levels=c("1","2","3","4","5"))
data$eq5d5l_q5 = factor(data$eq5d5l_q5,levels=c("1","2","3","4","5"))
data$repeatable_eq5d5l_complete = factor(data$repeatable_eq5d5l_complete,levels=c("0","1","2"))
data$gad7_q1 = factor(data$gad7_q1,levels=c("0","1","2","3"))
data$gad7_q2 = factor(data$gad7_q2,levels=c("0","1","2","3"))
data$gad7_q3 = factor(data$gad7_q3,levels=c("0","1","2","3"))
data$gad7_q4 = factor(data$gad7_q4,levels=c("0","1","2","3"))
data$gad7_q5 = factor(data$gad7_q5,levels=c("0","1","2","3"))
data$gad7_q6 = factor(data$gad7_q6,levels=c("0","1","2","3"))
data$gad7_q7 = factor(data$gad7_q7,levels=c("0","1","2","3"))
data$gad7_difficulty = factor(data$gad7_difficulty,levels=c("0","1","2","3"))
data$repeatable_general_anxiety_disorder_7_questionnair_complete = factor(data$repeatable_general_anxiety_disorder_7_questionnair_complete,levels=c("0","1","2"))
data$phq9_q1 = factor(data$phq9_q1,levels=c("0","1","2","3"))
data$phq9_q2 = factor(data$phq9_q2,levels=c("0","1","2","3"))
data$phq9_q3 = factor(data$phq9_q3,levels=c("0","1","2","3"))
data$phq9_q4 = factor(data$phq9_q4,levels=c("0","1","2","3"))
data$phq9_q5 = factor(data$phq9_q5,levels=c("0","1","2","3"))
data$phq9_q6 = factor(data$phq9_q6,levels=c("0","1","2","3"))
data$phq9_q7 = factor(data$phq9_q7,levels=c("0","1","2","3"))
data$phq9_q8 = factor(data$phq9_q8,levels=c("0","1","2","3"))
data$phq9_q9 = factor(data$phq9_q9,levels=c("0","1","2","3"))
data$repeatable_patient_health_questionnaire9_phq9_complete = factor(data$repeatable_patient_health_questionnaire9_phq9_complete,levels=c("0","1","2"))
data$mrcds_visit___1 = factor(data$mrcds_visit___1,levels=c("0","1"))
data$mrcds_visit___2 = factor(data$mrcds_visit___2,levels=c("0","1"))
data$mrcds_blness_exer_pre = factor(data$mrcds_blness_exer_pre,levels=c("1","0"))
data$mrcds_short_level_pre = factor(data$mrcds_short_level_pre,levels=c("1","0"))
data$mrcds_walk_slower_pre = factor(data$mrcds_walk_slower_pre,levels=c("1","0"))
data$mrcds_after_walk_pre = factor(data$mrcds_after_walk_pre,levels=c("1","0"))
data$mrcds_leave_house_pre = factor(data$mrcds_leave_house_pre,levels=c("1","0"))
data$mrcds_blness_exer_since = factor(data$mrcds_blness_exer_since,levels=c("1","0"))
data$mrcds_short_level_since = factor(data$mrcds_short_level_since,levels=c("1","0"))
data$mrcds_walk_slower_since = factor(data$mrcds_walk_slower_since,levels=c("1","0"))
data$mrcds_after_walk_since = factor(data$mrcds_after_walk_since,levels=c("1","0"))
data$mrcds_leave_house_since = factor(data$mrcds_leave_house_since,levels=c("1","0"))
data$repeatable_mrc_dyspnoea_scale_complete = factor(data$repeatable_mrc_dyspnoea_scale_complete,levels=c("0","1","2"))
data$sarcf_strength = factor(data$sarcf_strength,levels=c("0","1","2"))
data$sarcf_walk_difficult = factor(data$sarcf_walk_difficult,levels=c("0","1","2"))
data$sarcf_rise_from_a_chair = factor(data$sarcf_rise_from_a_chair,levels=c("0","1","2"))
data$sarcf_climb_stairs = factor(data$sarcf_climb_stairs,levels=c("0","1","2"))
data$sarcf_falls = factor(data$sarcf_falls,levels=c("0","1","2"))
data$repeatable_sarcf_questionnaire_complete = factor(data$repeatable_sarcf_questionnaire_complete,levels=c("0","1","2"))
data$gppaq_physical_amount = factor(data$gppaq_physical_amount,levels=c("1","2","3","4","5"))
data$gppaq_pe = factor(data$gppaq_pe,levels=c("0","1","2","3"))
data$gppaq_cycling = factor(data$gppaq_cycling,levels=c("0","1","2","3"))
data$gppaq_walking = factor(data$gppaq_walking,levels=c("0","1","2","3"))
data$gppaq_housework_childcare = factor(data$gppaq_housework_childcare,levels=c("0","1","2","3"))
data$gppaq_garden_diy = factor(data$gppaq_garden_diy,levels=c("0","1","2","3"))
data$gppaq_walk_pace = factor(data$gppaq_walk_pace,levels=c("1","2","3","4"))
data$gppaq_result = factor(data$gppaq_result,levels=c("4","3","2","1"))
data$repeatable_general_practice_physical_activity_ques_complete = factor(data$repeatable_general_practice_physical_activity_ques_complete,levels=c("0","1","2"))
data$dyspnoea_not_go_in = factor(data$dyspnoea_not_go_in,levels=c("0","1","2","3"))
data$dyspnoea_more_work = factor(data$dyspnoea_more_work,levels=c("0","1","2","3"))
data$dyspnoea_short = factor(data$dyspnoea_short,levels=c("0","1","2","3"))
data$dyspnoea_catching = factor(data$dyspnoea_catching,levels=c("0","1","2","3"))
data$dyspnoea_not_air = factor(data$dyspnoea_not_air,levels=c("0","1","2","3"))
data$dyspnoea_uncomfortable = factor(data$dyspnoea_uncomfortable,levels=c("0","1","2","3"))
data$dyspnoea_exhausting = factor(data$dyspnoea_exhausting,levels=c("0","1","2","3"))
data$dyspnoea_depressed = factor(data$dyspnoea_depressed,levels=c("0","1","2","3"))
data$dyspnoea_miserable = factor(data$dyspnoea_miserable,levels=c("0","1","2","3"))
data$dyspnoea_distressing = factor(data$dyspnoea_distressing,levels=c("0","1","2","3"))
data$dyspnoea_agitated = factor(data$dyspnoea_agitated,levels=c("0","1","2","3"))
data$dyspnoea_irritating = factor(data$dyspnoea_irritating,levels=c("0","1","2","3"))
data$repeatable_dyspnoea12_complete = factor(data$repeatable_dyspnoea12_complete,levels=c("0","1","2"))
data$facit_fatigued = factor(data$facit_fatigued,levels=c("0","1","2","3","4"))
data$facit_feel_weak = factor(data$facit_feel_weak,levels=c("0","1","2","3","4"))
data$facit_feel_listless = factor(data$facit_feel_listless,levels=c("0","1","2","3","4"))
data$facit_feel_tired = factor(data$facit_feel_tired,levels=c("0","1","2","3","4"))
data$facit_trouble_starting = factor(data$facit_trouble_starting,levels=c("0","1","2","3","4"))
data$facit_trouble_finishing = factor(data$facit_trouble_finishing,levels=c("0","1","2","3","4"))
data$facit_energy = factor(data$facit_energy,levels=c("0","1","2","3","4"))