Skip to content

Commit 0db2e21

Browse files
os2 slides all at once
0 parents  commit 0db2e21

File tree

595 files changed

+94445
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

595 files changed

+94445
-0
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
\section{Case study}
2+
3+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4+
5+
\begin{frame}
6+
\frametitle{Treating Chronic Fatigue Syndrome}
7+
8+
\begin{itemize}
9+
10+
\item Objective: Evaluate the effectiveness of cognitive-behavior therapy for chronic fatigue syndrome.
11+
12+
\item Participant pool: 142 patients who were recruited from referrals by primary care physicians and consultants to a hospital clinic specializing in chronic fatigue syndrome.
13+
14+
\item Actual participants: Only 60 of the 142 referred patients entered the study. Some were excluded because they didn't meet the diagnostic criteria, some had other health issues, and some refused to be a part of the study.
15+
16+
\end{itemize}
17+
18+
\ct{Deale et. al. \textit{Cognitive behavior therapy for chronic fatigue syndrome: A randomized controlled trial}. The American Journal of Psychiatry 154.3 (1997).}
19+
20+
\end{frame}
21+
22+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23+
24+
\begin{frame}
25+
\frametitle{Study design}
26+
27+
\begin{itemize}
28+
29+
\item Patients randomly assigned to treatment and control groups, 30 patients in each group:
30+
\begin{itemize}
31+
\item \hl{Treatment}: Cognitive behavior therapy -- collaborative, educative, and with a behavioral emphasis. Patients were shown on how activity could be increased steadily and safely without exacerbating symptoms.
32+
\item \hl{Control:} Relaxation -- No advice was given about how activity could be increased. Instead progressive muscle relaxation, visualization, and rapid relaxation skills were taught.
33+
\end{itemize}
34+
35+
\end{itemize}
36+
37+
\end{frame}
38+
39+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40+
41+
\begin{frame}
42+
\frametitle{Results}
43+
44+
The table below shows the distribution of patients with good outcomes at 6-month follow-up. Note that 7 patients dropped out of the study: 3 from the treatment and 4 from the control group.
45+
46+
\begin{center}
47+
\begin{tabular}{ll cc c}
48+
& & \multicolumn{2}{c}{\textit{Good outcome}} \\
49+
\cline{3-4}
50+
& & Yes & No & Total \\
51+
\cline{2-5}
52+
&Treatment & 19 & 8 & 27 \\
53+
\raisebox{1.5ex}[0pt]{\textit{Group}} &Control & 5 & 21 & 26 \\
54+
\cline{2-5}
55+
&Total & 24 & 29 & 53
56+
\end{tabular}
57+
\end{center}
58+
59+
\pause
60+
61+
\begin{itemize}
62+
63+
\item Proportion with good outcomes in treatment group:
64+
\[ 19 / 27 \approx 0.70 \rightarrow 70\% \]
65+
66+
\pause
67+
68+
\item Proportion with good outcomes in control group:
69+
\[ 5 / 26 \approx 0.19 \rightarrow 19\% \]
70+
71+
\end{itemize}
72+
73+
\end{frame}
74+
75+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76+
77+
\begin{frame}
78+
\frametitle{Understanding the results}
79+
80+
\dq{Do the data show a ``real" difference between the groups?}
81+
82+
\pause
83+
84+
\begin{itemize}
85+
86+
\item Suppose you flip a coin 100 times. While the chance a coin lands heads in any given coin flip is 50\%, we probably won't observe exactly 50 heads. This type of fluctuation is part of almost any type of data generating process.
87+
88+
\item The observed difference between the two groups (70 - 19 = 51\%) may be real, or may be due to natural variation.
89+
90+
\item Since the difference is quite large, it is more believable that the difference is real.
91+
92+
\item We need statistical tools to determine if the difference is so large that we should reject the notion that it was due to chance.
93+
94+
\end{itemize}
95+
96+
\end{frame}
97+
98+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99+
100+
\begin{frame}
101+
\frametitle{Generalizing the results}
102+
103+
\dq{Are the results of this study generalizable to all patients with chronic fatigue syndrome?}
104+
105+
\pause
106+
107+
These patients had specific characteristics and volunteered to be a part of this study, therefore they may not be representative of all patients with chronic fatigue syndrome. While we cannot immediately generalize the results to all patients, this first study is encouraging. The method works for patients with some narrow set of characteristics, and that gives hope that it will work, at least to some degree, with other patients.
108+
109+
110+
\end{frame}
111+
112+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
3+
\section{Data basics}
4+
5+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6+
7+
\subsection{Observations and variables}
8+
9+
\begin{frame}
10+
\frametitle{Data matrix}
11+
12+
Data collected on students in a statistics class on a variety of variables:
13+
14+
\begin{center}
15+
\begin{tabular}{l cccc l}
16+
& \hl{variable} \\
17+
& \hl{$\downarrow$} \\
18+
\cline{1-5}
19+
Stu. & \var{gender} & \var{intro\_extra} & $\cdots$ & \var{dread} \\
20+
\cline{1-5}
21+
1 & male & extravert & $\cdots$ & 3 \\
22+
2 & female & extravert & $\cdots$ & 2 \\
23+
3 & female & introvert & $\cdots$ & 4 & \hl{$\leftarrow$} \\
24+
4 & female & extravert & $\cdots$ & 2 & \hl{observation} \\
25+
$\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\
26+
86 & male & extravert & $\cdots$& 3 \\
27+
\cline{1-5}
28+
\end{tabular}
29+
\end{center}
30+
31+
\end{frame}
32+
33+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34+
35+
\subsection{Types of variables}
36+
37+
\begin{frame}
38+
\frametitle{Types of variables}
39+
40+
\begin{center}
41+
\includegraphics[width=0.9\textwidth]{1-2_data_basics/figures/variables/variables}
42+
\end{center}
43+
44+
\end{frame}
45+
46+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47+
48+
\begin{frame}
49+
\frametitle{Types of variables (cont.)}
50+
51+
\begin{center}
52+
{\footnotesize
53+
\begin{tabular}{c ccc cc}
54+
\hline
55+
& \var{gender} & \var{sleep} & \var{bedtime} & \var{countries} & \var{dread} \\
56+
\hline
57+
1 & male & 5 & 12-2 & 13 & 3 \\
58+
2 & female & 7 & 10-12 & 7 & 2 \\
59+
3 & female & 5.5 & 12-2 & 1 & 4 \\
60+
4 & female & 7 & 12-2 & & 2 \\
61+
5 & female & 3 & 12-2 & 1 & 3 \\
62+
6 & female & 3 & 12-2 & 9 & 4 \\
63+
\hline
64+
\end{tabular}
65+
}
66+
\end{center}
67+
68+
\begin{itemize}
69+
\item \var{gender}: \pause \soln{\only<2->{categorical}} \pause
70+
\item \var{sleep}: \pause \soln{\only<4->{numerical, continuous}} \pause
71+
\item \var{bedtime}: \pause \soln{\only<6->{categorical, ordinal}} \pause
72+
\item \var{countries}: \pause \soln{\only<8->{numerical, discrete}} \pause
73+
\item \var{dread}: \pause \soln{\only<10->{categorical, ordinal - could also be used as numerical}}
74+
\end{itemize}
75+
76+
\end{frame}
77+
78+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79+
80+
\begin{frame}
81+
\frametitle{Practice}
82+
83+
\pq{What type of variable is a telephone area code?}
84+
85+
\begin{enumerate}[(a)]
86+
\item numerical, continuous
87+
\item numerical, discrete
88+
\solnMult{categorical}
89+
\item categorical, ordinal
90+
\end{enumerate}
91+
92+
\end{frame}
93+
94+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95+
96+
\subsection{Relationships among variables}
97+
98+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99+
100+
\begin{frame}
101+
\frametitle{Relationships among variables}
102+
103+
\dq{Does there appear to be a relationship between GPA and number of hours students study per week?}
104+
105+
\begin{center}
106+
\includegraphics[width=0.7\textwidth]{1-2_data_basics/figures/gpa_study_hours/gpa_study_hours}
107+
\end{center}
108+
109+
\pause
110+
111+
\dq{Can you spot anything unusual about any of the data points?}
112+
113+
\soln{\pause{There is one student with GPA $>$ 4.0, this is likely a data error.}}
114+
115+
\end{frame}
116+
117+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118+
119+
\subsection{Associated and independent variables}
120+
121+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
122+
123+
\begin{frame}
124+
\frametitle{Practice}
125+
126+
\twocol{0.5}{0.5}
127+
{
128+
\pq{Based on the scatterplot on the right, which of the following statements is correct about the head and skull lengths of possums?}
129+
}
130+
{
131+
\includegraphics[width=\textwidth]{1-2_data_basics/figures/possum_head_skull/possum_head_skull}
132+
}
133+
134+
\begin{enumerate}[(a)]
135+
\item There is no relationship between head length and skull width, i.e. the variables are independent.
136+
\solnMult{Head length and skull width are positively associated.}
137+
\item Skull width and head length are negatively associated.
138+
\item A longer head causes the skull to be wider.
139+
\item A wider skull causes the head to be longer.
140+
\end{enumerate}
141+
142+
\end{frame}
143+
144+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145+
146+
\begin{frame}
147+
\frametitle{Associated vs. independent}
148+
149+
\begin{itemize}
150+
151+
\item When two variables show some connection with one another, they are called \hl{associated} variables.
152+
\begin{itemize}
153+
\item Associated variables can also be called \hl{dependent} variables and vice-versa.
154+
\end{itemize}
155+
156+
\item If two variables are not associated, i.e. there is no evident connection between the two, then they are said to be \hl{independent}.
157+
158+
\end{itemize}
159+
160+
\end{frame}
161+
162+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
library(openintro)
2+
data(COL)
3+
4+
d = read.csv("gpa_study_hours.csv")
5+
6+
myPDF('gpa_study_hours.pdf', 7, 4, mar=c(4,4,0.5,0.5))
7+
8+
plot(d$gpa ~ d$study_hours, pch = 19, col = COL[1,3], xlab = "Hours of study / week", ylab = "GPA", cex.lab = 1.5, cex.axis = 1.5)
9+
10+
dev.off()

β€ŽChp 1/1-2_data_basics/figures/gpa_study_hours/gpa_study_hours.csvβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gpa,study_hours4,103.8,253.93,453.4,10NA,NA3.9,NANA,123.69,NA3.2,43.2,NA3.52,103.68,243.4,403.7,10NA,NA3.75,103.3,303.425,73.795,153.5,NA3.83,603.3,103.75,104.3,NA3.15,63.7,203.8,83.63,303.9,353.294,123.7,63.4,204,103.4,143.7,103.8,103.4,303.4,20NA,NA3.4,73,203.6,163.567,143.3,213.4,213.6,113.67,103.82,102.9,153.9,103.4,103.6,203.1,103.4,103.8,123.7,253.7,203.8,253.9,NA3.92,153.8,103.868,403.35,153.85,103.55,103.7,253.65,253.125,364,303.25,143.86,23.5,103.45,53.6,4NA,NA3.866,203.82,123.2,153.5,33.8,103.8,153.7,253.75,153.3,103.875,153.7,73.5,14NA,NA3.2,73.566,403.5,64.3,103.6,103.2,20NA,113.825,203.85,693.75,84,103.4,33.9,83.825,153.7,453.8,102.91,183.559,103.69,103.3,353.75,103.9,83.65,153.5,303.6,353.675,203.9,123.6,353.675,83.7,303.66,103.733,143.7,282.6,74,203.2,153.16,243.7,NA3.5,203.65,203.9,203.785,253.1,153.15,163.61,103.3,35NA,103.7,153.7,203.75,40NA,NA3.4,43.6,123.5,493.8,203.7,303.925,NA3.84,123.85,NA3.41,83.825,602.95,6.53.925,203.3,183.3,103.6,40NA,NA4,21NA,303.3,12.53.89,123.2,203.97,103.3,103.3,NA3.86,203.76,203.8,NA3.5,10NA,203.6,303.55,153.97,203.925,153.68,143.25,53.56,52.85,83.6,83.45,143.5,153.15,203.35,143.5,143.79,253.022,303.46,203.55,303.97,203.925,73.2,83.4,203.9,14NA,NA3.6,203.83,603.8,154,203.5,153.3,84,153.1,103.5,73.62,203.6,103.8,283.2,123.925,53.84,303.1,54,63.33,NA3.35,303.925,153,93.6,243.7,123.84,153.8,103.1,15
Binary file not shown.

0 commit comments

Comments
Β (0)