-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbbr.tex
452 lines (397 loc) · 18.7 KB
/
bbr.tex
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
\documentclass{report}
% Usage: rubber -d bbr
% sudo apt-get install biber
% biber bbr
%
% Permanent location: hbiostat.org/doc/bbr.pdf
% Server is updated automatically because of symlink from ~/web/doc
\PassOptionsToPackage{hyphens}{url}
% Must appear before \usepackage{hyperref} (done by hslide). See
% https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url#3034
% Also need to put some lines between \begin{sloppypar} ... \end{sloppypar}
\usepackage[bib=slinks/harrelfe.bib]{hslide}
%\renewcommand{\mpfill}{\hfill} % see hslide.sty
\usepackage{knitrl}
%\usepackage{attachfile} % for attaching audio files
%\usepackage{fontenc}
%\usepackage[utf8]{inputenc} % see ~/bib/notes.txt
\newcommand{\sound}[1]{\marginpar{\href{http://hbiostat.org/audio/bbr/#1.m3u}{\includegraphics[width=0.45cm]{sound.png}}}}
\newcommand{\soundm}[1]{\marginpar{\href{http://hbiostat.org/audio/bbr/#1.mp3}{\includegraphics[width=0.45cm]{sound.png}}}}
\newcommand{\movie}[1]{\marginpar{\href{#1}{\includegraphics[width=0.6cm]{movie.png}}}}
\newcommand{\bmovie}[1]{\marginpar{\href{http://bit.ly/yt-bbr#1}{\includegraphics[width=0.6cm]{movie.png}}}}
\newcommand{\disc}[1]{\marginpar{\href{http://vbiostatcourse.slack.com/messages/bbr/search/#1}{\rotatebox{270}{\fbox{\small\textcolor{blue}{#1}}}}}}
\newcommand{\ddisc}[1]{\marginpar{\href{http://bit.ly/datamethods-bbr#1}{\includegraphics[width=0.6cm]{discourse.png}}}}
\newcommand{\blog}[1]{\marginpar{\href{http://fharrell.com/post/#1}{\rotatebox{270}{\fbox{\small\textcolor{blue}{blog}}}}}}
\renewcommand{\cite}[1]{\supercite{#1}}
\newcommand{\citet}[1]{\textcite{#1}}
\newcommand{\citep}[2]{\parencite[#2]{#1}} % #2 is page or section #
% Runs both \label{foo} and \hypertarget{foo}{} so that can link to
% places from browsers using
% e.g. hbiostat.org/doc/bbr.pdf#nameddest=foo
% \newcommand{\alabel}[1]{\label{#1}\hypertarget{#1}{}}
\newcommand{\alabel}[1]{\label{#1}}
% Redefine \label to add hypertarget anchor so that browsers can
% directly navigate to label using foo.pdf#nameddest=...
% See https://stackoverflow.com/questions/48322282
\AtBeginDocument{
\let\oldlabel\label
\renewcommand{\label}[1]{\oldlabel{#1}\hypertarget{#1}{}}
}
\newcommand{\attrib}[1]{\vspace{-4ex}\begin{flushright}\textcolor{blue}{\smaller
#1}\end{flushright}}
\newcommand{\quoteit}[2]{~~~~~~\parbox{4.5in}{\normalsize#1}\hfill\parbox{1.5in}{\normalsize\textcolor{blue}{#2}}}
\newcommand{\tsz}{\Large} % Table size
\newcommand{\tszs}{\large} % Next smallest table size
\newcommand{\Co}[1]{\texttt{\smaller #1}}
\newcommand{\co}[1]{\texttt{\smaller #1}}
\newcommand{\head}[1]{~\\\textbf{\smaller[-1]#1}\\}
\newcommand{\ignore}[1]{}
\newcommand{\btable}[2]{
\begin{center}#2
\begin{tabular}{#1}
}
\newcommand{\etable}{
\end{tabular}
\end{center}
}
\graphicspath{{R/}{descript/}{htest/}{prop/}{nonpar/}{corr/}{rmsintro/}{reg/}{multgroup/}{ancova/}{change/}{serial/}{obsvar/}{info/}{dx/}{hdata/}{repro/}}
\newcommand{\fig}[3]{\begin{figure}[!htbp]
\leavevmode
\centerline{\scalebox{#3}{\includegraphics{#1.pdf}}}
\caption{\large#2}
\alabel{#1}
\end{figure}}
\newcommand{\figs}[3]{\begin{figure}[!htbp]
\leavevmode
\centerline{\scalebox{#3}{\includegraphics{slinks/#1.pdf}}}
\caption{\large#2}
\alabel{#1}
\end{figure}}
\newcommand{\bfig}[2]{\begin{figure}[!htbp]
\leavevmode
\centerline{\includegraphics{#1.pdf}}
\caption{\large#2}
\alabel{#1}
\end{figure}}
\renewcommand{\thefootnote}{\alph{footnote}}
\makeatletter
\def\blfootnote{\xdef\@thefnmark{}\@footnotetext}
\makeatother
% Note: in htest/slide.Rnw counter set back to 1 because hit footnote z
\newcommand{\sfbox}[1]{%
\setlength{\fboxrule}{0.05pt}\setlength{\fboxsep}{1pt}%
\fbox{\scriptsize #1}%
\setlength{\fboxrule}{0.4pt}\setlength{\fboxsep}{3pt}}
%\newcommand{\rref}[1]{\marginpar{\sfbox{#1}}}
%\newcommand{\ems}[1]{\marginpar{\sfbox{EMS$#1$}}}
\newcommand{\ems}[1]{}
%\newcommand{\abd}[1]{\marginpar{\parbox{1in}{\textcolor{blue}{ABD$#1$}}}}
%\newcommand{\abd}[1]{\textcolor{blue}{\sfbox{ABD$#1$}}}
%\newcommand{\rms}[1]{\marginpar{\parbox{1in}{\textcolor{blue}{\sfbox{RMS$#1$}}}}}
%\newcommand{\rms}[1]{\textcolor{blue}{\sfbox{RMS$#1$}}}
%\newcommand{\bookref}[2]{\marginpar{\hfill\textcolor{blue}{\small#1#2}}}
\newcommand{\bookref}[2]{\marginpar{\rotatebox{270}{\textcolor{blue}{\small#1#2}}}}
\newcommand{\abd}[1]{\bookref{ABD}{#1}}
\newcommand{\rms}[1]{\bookref{RMS}{#1}}
%\setlength\marginparwidth{1.5in}
%\setlength\marginparsep{-0.5in} ?
\newcommand{\ros}[1]{}
\newcommand{\altman}[1]{}
\newcommand{\katz}[1]{}
\newcommand{\twoheadleftarrow}{<\leftarrow}
\begin{document}
\author{ }
\vspace*{\stretch{1}}
\noindent\rule{\linewidth}{1mm}
\def\originalBBR{1} % originalBBR=1 if the original BBR; set to 0 otherwise
\ifnum\originalBBR=1
\begin{flushright}
\Huge
\includegraphics[width=3.5in]{logo.png}\hfill\textsc{Biostatistics for\\Biomedical Research}\\[2ex]
%Sessions 1, 3--4, 6, 7 \\[2ex]
\huge Frank E Harrell Jr \\ James C Slaughter \\
\Large
Department of Biostatistics \\
Vanderbilt University School of Medicine \\
\texttt{[email protected]} \\ \texttt{[email protected]}
\\[2ex] \href{https://biostat.app.vumc.org/wiki/ClinStat}{biostat.app.vumc.org/ClinStat}\\
Questions/discussions/topic suggestions: \\\href{http://datamethods.org/t/bbr-video-course}{\url{datamethods.org/t/bbr-video-course}}\\
%\\Slack channel \texttt{bbr} in
%\href{http://vbiostatcourse.slack.com}{vbiostatcourse.slack.com}\\
Web course: \href{https://hbiostat.org/bbr}{\texttt{hbiostat.org/bbr}}\\
\R\ code in text: \href{http://hbiostat.org/bbr/code.zip}{hbiostat.org/bbr/code.zip}\\
Glossary of statistical terms: \url{bit.ly/stat-glossary}\\
Statistical papers written for biomedical researchers: \url{hbiostat.org/bib}\\
Blog: \href{http://fharrell.com}{fharrell.com}\\
{\smaller \verb|@f2harrell #bbrcourse|}
\\[2ex]
\small
\end{flushright}
\rule{\linewidth}{1mm}
\vspace*{\stretch{2}}
\begin{center}
\vspace{.5in}
\small
Copyright 2001-2020 FE Harrell \& JC Slaughter ~~~ All Rights Reserved
\\ \hfill \scriptsize Updated \today
\end{center}
\else % set to 0 otherwise: for Biostatistics for Pharmacy Research
\begin{flushright}
\Huge
\textsc{Biostatistics for\\Pharmacy Research}\\[2ex]
%Sessions 1, 3--4, 6, 7 \\[2ex]
\huge Frank E Harrell Jr \\ James C Slaughter \\ Leena Choi \\
\Large
Department of Biostatistics \\
Vanderbilt University School of Medicine \\
%\\[2ex] \url{biostat.mc.vanderbilt.edu/ClinStat}\\
%Questions/discussions:\\Slack channel \texttt{bbr} in
%\href{http://vbiostatcourse.slack.com}{vbiostatcourse.slack.com}\\
%Blog: \href{http://fharrell.com}{fharrell.com}
%\\[2ex]
\small
\end{flushright}
\rule{\linewidth}{1mm}
\vspace*{\stretch{2}}
\begin{center}
\vspace{.5in}
\small
Copyright 2001-2017 FE Harrell \& JC Slaughter \& L Choi ~~~ All Rights Reserved
\\ \hfill \scriptsize Updated \today
\end{center}
\fi
\thispagestyle{empty}
\pagenumbering{roman}
\pagestyle{headings}
\setcounter{tocdepth}{1}
%{\smaller \textbf{Glossary of statistical terms}: \url{bit.ly/stat-glossary}}
%\url{http://biostat.mc.vanderbilt.edu/wiki/pub/Main/ClinStat/glossary.pdf}}
\tableofcontents
\def\changeHistoryShow{1} % show change history if 1; set 0 otherwise
\ifnum\changeHistoryShow=1
\bigskip
\need 3.5in
%\textbf{Changes Since 2015-03-26}\footnote{As of 2015-12-06 chapters after
%chapter 1 are renumbered by increasing by 1 because of insertion of algebra
%review chapter.}
\textbf{Changes Since 2017-01-01}
\begin{center}\small
\begin{tabular}{lll}
Section & Date Modified & Description \\ \hline
\ignore{
9.11 & 2015-04-02 & New section on model validation \\
3.3.5 & 2015-04-07 & Color image plots showing interactions \\
4 & 2015-04-12 & Added \R\ code for all calculations \\
1.4 & 2015-04-14 & Added how-to REDCap enhanced import \\
17.7 & 2015-04-17 & New section \\
16.2.1 & 2015-04-21 & New section \\
1-3 & 2015-04-21 & Added section numbers in ABD \\
4.1, 4.10 & 2015-04-22 & New sections \\
1.2-1.3 & 2015-04-23 & Re-wrote section 1.3, slight change to 1.2\\
1.4 & 2015-04-25 & Fetch importREDCap function in a new way\\
4.10 & 2015-04-25 & New subsection on multiplicity\\
13 & 2015-04-26 & Added back several missing pages\\
code.zip& & Updated\\
1.3 & 2015-05-03 & Added options() before use getRs\\
1.3 & 2015-05-04 & Added screenshots of RStudio setup\\
4.3 & 2015-05-05 & Clarified Bayesian/frequentist example and
added interim analysis\\
3 & 2015-05-06 & Improved formatting of 2 graphs\\
9 & 2015-05-18 & Added more output in lead case study\\
1.4, 1.5& 2015-05-19 & New sections with info about chunk headers, R
Markdown\\
12.6.1 & 2015-05-29 & New subsection on relative vs. absolute risk
for HTE\\
12.6.2 & 2015-05-31 & New example showing $|$risk reduction$|$ by\\
& & background risk and interacting factor\\
1.6-1.8 & 2015-06-24 & Edited section, added new csv import example\\
20 & 2015-10-18 & Added quotes and new reference\\
9.11 & 2015-10-21 & Added text about what model validation really
does\\
18.3 & 2015-10-23 & Expanded decision making steps\\
2 & 2015-12-06 & New chapter - algebra overview\\
10 & 2015-12-06 & Expanded with more bullet points\\
10.5.4 & 2015-12-30 & Added code to run least squares fitting demo\\
1.1 & 2016-01-09 & Added new R specialty packages for biomedical research\\
10 & 2016-01-10 & Added hyperlink to a Youtube video for the start of\\
& & the chapter, and audio hyperlinks for other sections,\\
& & with audio cues indicated with red letters in
right margin\\
8.5.2 & 2016-01-20 & Improve correlation precision graph\\
& 2016-01-20 & Updated ggplot2 twice for stat\_binhex call\\
10.6 & 2016-01-23 & Removed 2 subsections that duplicated RMS\\
14.8 & 2016-01-31 & Added video for regression to the mean\\
10.10.4 & 2016-02-02 & Inserted 1-line section to refer to chapter 9 for full example\\
9 & 2016-05-28 & Added text giving the reasons for the \co{rms} package\\
17.1,17.3-4 & & More information about propensity score
analysis\\
4.3.2 & 2016-06-21 & Added frequency multi-way dot chart\\
17.6 & 2016-12-01 & New short section on alternatives to
propensity\\
17 & 2016-12-04 & Added material on covariate interactions\\
5.4 & 2016-12-10 & Added best reference on misinterpretations of\\
& & p-values, with quotes in new subsection 5.4.1\\ }
& 2017-01-25 & Began adding slack discussion keys\\
20.3 & 2017-02-01 & Suggested stat plan wording for ranking genes\\
13 & 2017-03-09 & Slack discussion keys added, new intro \\
6.9.4 & 2017-05-31 & Upper CL for odds ratio was wrong \\
13.6.1 & 2017-06-22 & New examples of displaying HTE \\
5.6.3 & 2017-09-12 & Added MMOE for estimating odds \\
21.1 & 2017-09-20 & Added new comprehensive ref on repro res \\
14 & 2017-11-12 & Several improvements in analysis of change\\
7.4 & 2017-12-01 & Clarified difference in medians vs.\ H-L\\
3.5 & 2017-12-24 & New section on statistical information by
variable type\\
19.3 & 2017-12-29 & New web site wonderfully illustrating optimum
Bayes decisions\\
8.5.1 & 2017-12-29 & New text and reference: controversy over
Bland-Altman\\
13.1 & 2017-12-31 & Added Bland-Altman reference on impropriety of
testing for baseline balance in RCT\\
21 & 2018-01-08 & Added material from personalized med talk\\
& 2018-01-28 & code.zip updated, moved to fharrell.com/code\\
18.3.1 & 2018-04-10 & Added example of categorizing height and weight\\
& & when assessing importance of BMI\\
10.11.1 & 2018-04-13 & New subsection on choice of validation methods\\
4.2.2 & 2018-04-14 & Added Gini's mean difference\\
3.8 & 2018-04-14 & New section - probability overview\\
5.8.2 & 2019-06-21 & Example of needed observed differences in means\\
1.2 & 2019-06-29 & Link to Norm Matloff material for learning R\\
13 & 2019-08-11 & Added link to Senn article, fixed plotting\\
& & contrasts as.data.frame\\
3 & 2019-08-25 & many\\
4.3 & 2019-08-30 & reference RCTGraphics wiki\\
3.2.1 & 2019-09-16 & new section\\
3.8 & 2019-10-10 & added McElreath's terminology\\
3.9 & 2019-10-10 & added baseball batting average example\\
3.2.1.1 & 2019-10-15 & new section on planning observational research\\
4.3 & 2019-10-15 & new links, more info about interactive graphics\\
4.5 & 2019-10-16 & moved to 4.3.4\\
4.3.4 & 2019-10-16 & new section on semi-interactive graphics\\
4.4 & 2019-10-19 & new opinions about tables\\
5 & 2019-10-22 & many changes for BBR course\\
5.1.1 & 2019-10-24 & new section on central limit theorem\\
5.5 & 2019-10-27 & new section on interval estimation\\
5.6 & 2019-11-09 & added Bayes\\
5.9 & 2019-12-02 & added Bayes, many other changes\\
& 2019-12-07 & added hyperlinks for YouTube BBR sessions and datamethods.org\\
5.12 & 2019-12-09 & many\\
6 & 2019-12-11 & added frequentist and Bayesian logistic model\\
7 & 2019-12-30 & several minor changes\\
7.6-7.8 & 2020-01-19 & new sections on PO model and power\\
8 & 2020-01-25 & new sections on bootstrapping correlation matrices\\
14.4.1 & 2020-02-03 & Added S Senn change from baseline graph\\
10 & 2020-03-15 & Several corrections and improvements from Drew Levy\\
15 & 2020-04-23 & Added audio narration for chapter\\
17 & 2020-05-28 & many\\
\hline
\end{tabular}\end{center}
\else
\fi
Blue symbols in the right margin starting with ABD designate
section numbers (and occasionally page numbers preceeded by $p$)
% in Rosner's sixth edition (numbers given by R$nn$), page numbers in
% Altman, Machin, Bryant, and Gardner (numbers given by A$nn$),
% section numbers in Katz (numbers given by K$nn$), or section numbers
%in Essential Medical Statistics (EMS$nn$) by Kirkwood and Sterne,
%second edition (2003).}
in \emph{The Analysis of Biological Data, Second Edition} by MC Whitlock and D
Schluter, Greenwood Village CO, Roberts and Company, 2015. Likewise, right
blue symbols starting with RMS designate section numbers in \emph{Regression
Modeling Strategies, 2nd ed.} by FE Harrell, Springer, 2015.
\includegraphics[width=0.6cm]{movie.png} in the right margin indicates
a hyperlink to a YouTube video related to the subject.
There is a YouTube channel (\texttt{BBRcourse}) for these notes at
\href{http://bit.ly/yt-bbr}{bit.ly/yt-bbr}
or by searching for YouTube channel \texttt{BBRcourse}. A discussion
board about the overall course is at \href{http://datamethods.org/t/bbr-video-course}{\url{datamethods.org/t/bbr-video-course}}. You can go directly to a YouTube video for BBR Session n by going to \url{bit.ly/yt-bbrn}.
\includegraphics[width=0.5cm]{discourse.png} in the right margin is a hyperlink to the discussion topic in \url{datamethods.org} devoted to the specific YouTube video session. You can go directly to the discussion about session n by going to \url{bit.ly/datamethods-bbrn}. Some of the session on YouTube also had live chat which you can select to replay while watching the video.
\includegraphics[width=0.6cm]{sound.png} in the right margin is a
hyperlink to an audio file\footnote{The first time you click on one of
these, some browsers download the audio file and give you the
opportunity to right click to open the file on your local audio
player, then the browser asks if you always want to open files of
this type. Select ``yes''.} elaborating on the notes. Red letters and
numbers in the right margin are cues referred to within the audio
recordings.
\href{http://hbiostat.org/audio/bbr/all.m3u}{Here} is a link
to the playlist for all audio files in these notes.
Rotated boxed blue text in the right margin at the start of a section
represents \disc{howto}
the mnemonic key for linking to discussions about that section in
\href{https://vbiostatcourse.slack.com}{vbiostatcourse.slack.com} channel \verb|#bbr|. Anyone starting a
new discussion about a topic related to the section should include the
mnemonic somewhere in the posting,
and the posting should be marked to \co{slack} as threaded. The
mnemonic in the right margin is also a hyperlink to a search in the
\verb|bbr| channel for messages containing the mnemonic. When you
click on it the relevant messages will appear in the search results on
the right side of the \co{slack} browser window. Note: Slack is not being used for new discussions. Use \url{datamethods.org} topics devoted to BBR video sessions instead, or open a new topic for topics that are not part of the BBR web course.
Members of
the \verb|slack| group can also create submnemonics for subsections or
other narrower-scope parts of the notes. When creating keys ``on the
fly,'' use names of the form \verb|chapterkey-sectionkey-yourkey|
where \verb|sectionkey| is defined in the notes.
That way a search on \verb|chapterkey-sectionkey| will also bring up
notes related to \verb|yourkey|.
Several longer and more discussed subsections in the text have already
been given short keys in these notes.
Beginning in 2019, the use of \verb|slack| for questions, answers, and
discussion is no longer recommended. Instead use
\verb|datamethods.org| where separate special topics are created for
some of the chapters in these notes.
\textcolor{blue}{blog} in the right margin is a link to a blog entry
that further discusses the topic.
\clearpage
\pagenumbering{bychapter}
\Large
%\huge
\def\basicStat{0} % basicStat = 1 if only include basic statistics; set to 0 otherwise
\ifnum\basicStat=1
\input{R/slide}
\input{algebra}
\input{overview}
\input{descript/slide}
%\input{htest/slide}
%\input{prop/slide}
%\input{nonpar/slide}
%\input{corr/slide}
%\input{rmsintro/slide}
%\input{reg/slide}
%\input{multgroup/slide}
%\input{infreview}
%\input{ancova/slide}
%\input{change/slide}
%\input{serial/slide}
%\input{obsvar/slide}
%\input{propensity}
%\input{info/slide}
%\input{dx/slide}
%\input{hdata/slide}
%\input{repro/slide}
\else
\input{R/slide}
\input{algebra}
\input{overview}
\input{descript/slide}
\input{htest/slide}
\input{prop/slide}
\input{nonpar/slide}
\input{corr/slide}
\input{rmsintro/slide}
\input{reg/slide}
\input{multgroup/slide}
\input{infreview}
\input{ancova/slide}
\input{change/slide}
\input{serial/slide}
\input{obsvar/slide}
\input{propensity}
\input{info/slide}
\input{dx/slide}
\input{hdata/slide}
\input{repro/slide}
\fi
\dobib
\end{document}