-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmetadata.R
115 lines (90 loc) · 2.35 KB
/
metadata.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
#' ---
#' title: "RAI, Metadata"
#' author: "Wilson, Bokov, Shireman"
#' date: "08/15/2017"
#' ---
#'
#' This file (`metadata.R`) is loaded before the data is loaded, so you should not
#' rely on the data anywhere in this file. Please stick to variable assignments
#' that are not specific to your own computer (those go into `config.R`). Also
#' do not create functions here. Those go into `functions.R`
#'
#' ## Non-analytic column names or regexps
#'
#' Please create below as many lines as you need to for the the code you
#' are using to find the columns which should be excluded from all plots,
#' tables, and models. These columns include but are not limited to
#' patient/visit IDs, free text, and anything that is a comma-separated list
#' of codes. These should be character vectors either of column names or of grep
#' patterns for selecting those names.
#' ## Column-names that may need to be transformed
#'
#' Same idea as above section
#'
#' ### Numeric
#'
cnum <- c();
#' ### Numeric columns that it would make sense to bin
#'
#' Such as BMI, age, and income
cnum2bin <- c();
#' ### Date
#'
cdate <- c();
#' ### Boolean/Logical
#'
ctf <- c();
#' ### Factor/Discrete
#'
cfactr <- c();
#' ### Integer
#'
cintgr <- c();
#' ## Outcomes
#'
#' ### Clavien-Dindo 4 column names
#'
ccd4 <- c();
#' ### All Complications column names
#'
ccomp <- c();
#' ### Complications to exclude column names (2)
#'
ccompexc <- c();
#' ### Serious complications
#'
csrscomp <- setdiff(ccomp,ccompexc);
#' ### PATOS
#'
#' Columns that _have_ a corresponding PATOS (present at time of surgery)
#' column
chavepatos <- c();
#' Columns that _are_ PATOS columns
#'
#' Note that this one is a regexp so let's name the variable that holds it
#' a name that begins with 'g'. Feel free to make whichever variables are
#' convenient into lists or regexps instead of literal names.
garepatos <- c('_patos$');
#' ### Time-to-event column names
#'
ctime <- c();
#' ## Predictors
#'
#' ### RAI components
crai <- c();
#' ### Various individual predictors
#'
#' (replace the empty strings with actual column names of your data frame)
#' These start with v to indicate individual exact variable names rather than
#' vectors
#'
#' Hispanic
vhisp <- '';
#' Income
vinc <- '';
#' Patient ID (for grouping)
vid <- '';
#' Date of surgery
vdts <- '';
#' Date of birth
vdob <- '';