-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
173 lines (149 loc) · 5.62 KB
/
README.Rmd
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
---
title: "Lecture and lab materials for CUNY SPH Biostatistics 2"
author: "Levi Waldron"
output:
md_document:
preserve_yaml: false
always_allow_html: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
<!-- badges: start --> ![Website and Docker](https://github.com/waldronbios2/cunybios2/workflows/Website%20and%20Docker/badge.svg) <!-- badges: end -->
# Overview
This course is designed to expand on the biostatistical methods
covered in Applied Biostatistics I. It introduces generalized linear
regression including logistic regression, loglinear models (including
Poisson and Negative Binomial models of count data), survival
analysis, and longitudinal data including random and mixed effect
models.
# Materials
```{r youtube, echo=FALSE}
chapters <- dir(pattern = "session*")
chapters <- chapters[order(as.integer(sub("session", "", chapters)))]
youtube <- read.csv("youtubeURLs.csv")[1:length(chapters), ]
youtube$lecturetips <-
ifelse(youtube$lecture == "#", "not yet available", "watch on YouTube")
youtube$labtips <-
ifelse(youtube$lab == "#", "not yet available", "watch on YouTube")
```
```{r packages, echo=FALSE}
suppressPackageStartupMessages({
library(dplyr)
library(kableExtra)
})
```
```{r links, echo=FALSE}
badgeimages <- paste0("https://github.com/waldronbios2/", chapters,
"/workflows/build/badge.svg")
badgeimagehtml <- paste0("<img src='", badgeimages, "'>")
badgelinks <- paste0("https://github.com/waldronbios2/", chapters, "/actions")
badgeall <- paste0("<a href = '", badgelinks, "'>", badgeimagehtml, "</a>")
```
```{r, echo=FALSE}
dt <- data.frame(
session = cell_spec(
seq_along(chapters),
tooltip = sapply(chapters, function(x) {
pd <- packageDescription(x)
if (!is(pd, "packageDescription")){
warning(x, " is not a package")
return(NA)
}
return(packageDescription(x)$Description)
}),
link = paste0("https://waldronbios2.github.io/", chapters)
),
status = badgeall,
git = cell_spec(
"git clone",
tooltip = "use for git clone click to go to GitHub repo",
link = paste0("https://github.com/waldronbios2/", chapters, ".git")
),
lecture = cell_spec(
"HTML",
tooltip = "lecture notes in HTML",
link = paste0(
"https://waldronbios2.github.io/",
chapters,
"/articles/session_lecture.html"
)
),
lecturepdf = cell_spec(
"PDF",
tooltip = "lecture notes in PDF",
link = paste0(
"https://waldronbios2.github.io/",
chapters,
"/articles/session_lecture.pdf"
)
),
lecturevideo = cell_spec(
"watch",
tooltip = youtube$lecturetips,
link = youtube$lecture[1:length(chapters)]
),
labhtml = cell_spec(
"HTML",
tooltip = "lab notes in HTML",
link = paste0(
"https://waldronbios2.github.io/",
chapters,
"/articles/session_lab.html"
)
),
labvideo = cell_spec("watch",
tooltip = youtube$labtips,
link = youtube$lab[1:length(chapters)])
)
```
```{r maketable, echo=FALSE}
kableExtra::kbl(
dt,
format = "html",
escape = FALSE,
col.names = NULL,
align = "c"
) %>%
kable_paper() %>%
kableExtra::kable_styling(
bootstrap_options = "striped",
full_width = FALSE,
position = "center"
) %>%
kableExtra::add_header_above(c(
"Session" = 1,
"Status" = 1,
"GitHub" = 1,
"Lecture" = 3,
"Lab" = 2
))
```
# Cloning course materials (for students)
You can download course materials individually from this website, but it is more convenient to clone all course materials at once. However, cloning requires a system installation of `git`, and the installation methods depend on your operating system. Here are [git installation instructions for RStudio](https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN). If you are using RStudio on https://anvil.terra.bio (ask the professor for access with free compute), `git` is pre-installed so you don't have to install it. Once you have git working from RStudio, you can do the following to obtain a local copy of all course materials:
1. In RStudio, select "File - New Project" (no need to save workspace image, I never do. That's a copy of any objects in memory in your R session, but you want to create these with your script anyways)
2. Choose "Version Control" then "Git".
3. Enter the URL: https://github.com/waldronbios2/cunybios2.git . Also enter any directory name (e.g. "lectures and labs" or "cunybios2"), and click "Browse" to choose the current directory. Then click "Create Project"
4. On the bottom left-hand quadrant of RStudio, click "Terminal". In the terminal, enter the following two commands:
+ `git submodule init`
+ `git submodule update`
That's it! You can now find 10 sessions worth of lecture and lab code, e.g. in "File - Open" or the file browser, click on "Session1" and "vignettes" to see the lecture and lab materials. Once you open an Rmd file you can click "Knit" to build it.
# Data Science Units
This course is supported by free access to
[DataCamp](https://www.datacamp.com/) for registered students.
# Technical notes for teachers
To add a new git submodule to this repo:
First, add the new session to the Suggests and Remotes sections of the
DESCRIPTION file.
Second, invoke the following from within the local waldronbios2 clone
(example for session10):
```
git submodule add https://github.com/waldronbios2/session10.git`
git commit -am "add session10 submodule"
```
Finally, update the file `youtubeURLs.csv` with links to lecture and lab
recordings, then push changes:
```
git commit -am "add session10 recording links"
git push origin master
```