Skip to content

Commit acb3541

Browse files
committed
Made minor modifications to lecture 2
1 parent 3cd703c commit acb3541

File tree

3 files changed

+111
-106
lines changed

3 files changed

+111
-106
lines changed

07_RegressionModels/01_02_notation/index.Rmd

+2-12
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ framework : io2012 # {io2012, html5slides, shower, dzslides, ...}
88
highlighter : highlight.js # {highlight.js, prettify, highlight}
99
hitheme : tomorrow #
1010
url:
11-
lib: ../../libraries
12-
assets: ../../assets
11+
lib: ../../librariesNew
12+
assets: ../../assetsNew
1313
widgets : [mathjax] # {mathjax, quiz, bootstrap}
1414
mode : selfcontained # {standalone, draft}
1515
---
@@ -30,10 +30,6 @@ mode : selfcontained # {standalone, draft}
3030
* We often use a different letter than $X$, such as $Y_1, \ldots , Y_n$.
3131
* We will typically use Greek letters for things we don't know.
3232
Such as, $\mu$ is a mean that we'd like to estimate.
33-
* We will use capital letters for conceptual values of the variables and lowercase letters for realized values.
34-
* So this way we can write $P(X_i > x)$.
35-
* $X_i$ is a conceptual random variable.
36-
* $x$ is a number that we plug into.
3733

3834
---
3935
## The empirical mean
@@ -48,7 +44,6 @@ $$
4844
$$
4945
The mean of the $\tilde X_i$ is 0.
5046
* This process is called "centering" the random variables.
51-
* The mean is a measure of central tendency of the data.
5247
* Recall from the previous lecture that the mean is
5348
the least squares solution for minimizing
5449
$$
@@ -67,9 +62,6 @@ $$
6762
* The empirical standard deviation is defined as
6863
$S = \sqrt{S^2}$. Notice that the standard deviation has the same units as the data.
6964
* The data defined by $X_i / s$ have empirical standard deviation 1. This is called "scaling" the data.
70-
* The empirical standard deviation is a measure of spread.
71-
* Sometimes people divide by $n$ rather than $n-1$ (the latter
72-
produces an unbiased estimate.)
7365

7466
---
7567
## Normalization
@@ -93,8 +85,6 @@ Cov(X, Y) =
9385
\frac{1}{n-1}\sum_{i=1}^n (X_i - \bar X) (Y_i - \bar Y)
9486
= \frac{1}{n-1}\left( \sum_{i=1}^n X_i Y_i - n \bar X \bar Y\right)
9587
$$
96-
* Some people prefer to divide by $n$ rather than $n-1$ (the latter
97-
produces an unbiased estimate.)
9888
* The correlation is defined is
9989
$$
10090
Cor(X, Y) = \frac{Cov(X, Y)}{S_x S_y}

07_RegressionModels/01_02_notation/index.html

+105-80
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,46 @@
88
<meta name="generator" content="slidify" />
99
<meta name="apple-mobile-web-app-capable" content="yes">
1010
<meta http-equiv="X-UA-Compatible" content="chrome=1">
11-
<link rel="stylesheet" href="../../libraries/frameworks/io2012/css/default.css" media="all" >
12-
<link rel="stylesheet" href="../../libraries/frameworks/io2012/phone.css"
11+
<link rel="stylesheet" href="../../librariesNew/frameworks/io2012/css/default.css" media="all" >
12+
<link rel="stylesheet" href="../../librariesNew/frameworks/io2012/css/phone.css"
1313
media="only screen and (max-device-width: 480px)" >
14-
<link rel="stylesheet" href="../../libraries/frameworks/io2012/css/slidify.css" >
15-
<link rel="stylesheet" href="../../libraries/highlighters/highlight.js/css/tomorrow.css" />
16-
<base target="_blank"> <!-- This amazingness opens all links in a new tab. -->
17-
<script data-main="../../libraries/frameworks/io2012/js/slides"
18-
src="../../libraries/frameworks/io2012/js/require-1.0.8.min.js">
14+
<link rel="stylesheet" href="../../librariesNew/frameworks/io2012/css/slidify.css" >
15+
<link rel="stylesheet" href="../../librariesNew/highlighters/highlight.js/css/tomorrow.css" />
16+
<base target="_blank"> <!-- This amazingness opens all links in a new tab. -->
17+
18+
<!-- Grab CDN jQuery, fall back to local if offline -->
19+
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
20+
<script>window.jQuery || document.write('<script src="../../librariesNew/widgets/quiz/js/jquery.js"><\/script>')</script>
21+
<script data-main="../../librariesNew/frameworks/io2012/js/slides"
22+
src="../../librariesNew/frameworks/io2012/js/require-1.0.8.min.js">
1923
</script>
2024

21-
<link rel="stylesheet" href = "../../assets/css/custom.css">
22-
<link rel="stylesheet" href = "../../assets/css/custom.css.BACKUP.546.css">
23-
<link rel="stylesheet" href = "../../assets/css/custom.css.BASE.546.css">
24-
<link rel="stylesheet" href = "../../assets/css/custom.css.LOCAL.546.css">
25-
<link rel="stylesheet" href = "../../assets/css/custom.css.orig">
26-
<link rel="stylesheet" href = "../../assets/css/custom.css.REMOTE.546.css">
27-
<link rel="stylesheet" href = "../../assets/css/ribbons.css">
25+
2826

2927
</head>
3028
<body style="opacity: 0">
3129
<slides class="layout-widescreen">
3230

3331
<!-- LOGO SLIDE -->
34-
<!-- END LOGO SLIDE -->
32+
<slide class="title-slide segue nobackground">
33+
<aside class="gdbar">
34+
<img src="../../assetsNew/img/bloomberg_shield.png">
35+
</aside>
36+
<hgroup class="auto-fadein">
37+
<h1>Some basic notation and background</h1>
38+
<h2>Regression</h2>
39+
<p>Brian Caffo, PhD<br/>Johns Hopkins Bloomberg School of Public Health</p>
40+
</hgroup>
41+
<article></article>
42+
</slide>
3543

3644

37-
<!-- TITLE SLIDE -->
38-
<!-- Should I move this to a Local Layout File? -->
39-
<slide class="title-slide segue nobackground">
40-
<aside class="gdbar">
41-
<img src="../../assets/img/bloomberg_shield.png">
42-
</aside>
43-
<hgroup class="auto-fadein">
44-
<h1>Some basic notation and background</h1>
45-
<h2>Regression</h2>
46-
<p>Brian Caffo, PhD<br/>Johns Hopkins Bloomberg School of Public Health</p>
47-
</hgroup>
48-
</slide>
49-
5045
<!-- SLIDES -->
51-
<slide class="" id="slide-1" style="background:;">
46+
<slide class="" id="slide-1" style="background:;">
5247
<hgroup>
5348
<h2>Some basic definitions</h2>
5449
</hgroup>
55-
<article>
50+
<article data-timings="">
5651
<ul>
5752
<li>In this module, we&#39;ll cover some basic definitions and notation used throughout the class.</li>
5853
<li>We will try to minimize the amount of mathematics required for this class.</li>
@@ -63,11 +58,11 @@ <h2>Some basic definitions</h2>
6358
<!-- Presenter Notes -->
6459
</slide>
6560

66-
<slide class="" id="slide-2" style="background:;">
61+
<slide class="" id="slide-2" style="background:;">
6762
<hgroup>
6863
<h2>Notation for data</h2>
6964
</hgroup>
70-
<article>
65+
<article data-timings="">
7166
<ul>
7267
<li>We write \(X_1, X_2, \ldots, X_n\) to describe \(n\) data points.</li>
7368
<li>As an example, consider the data set \(\{1, 2, 5\}\) then
@@ -78,24 +73,17 @@ <h2>Notation for data</h2>
7873
<li>We often use a different letter than \(X\), such as \(Y_1, \ldots , Y_n\).</li>
7974
<li>We will typically use Greek letters for things we don&#39;t know.
8075
Such as, \(\mu\) is a mean that we&#39;d like to estimate.</li>
81-
<li>We will use capital letters for conceptual values of the variables and lowercase letters for realized values.
82-
83-
<ul>
84-
<li>So this way we can write \(P(X_i > x)\). </li>
85-
<li>\(X_i\) is a conceptual random variable.</li>
86-
<li>\(x\) is a number that we plug into.</li>
87-
</ul></li>
8876
</ul>
8977

9078
</article>
9179
<!-- Presenter Notes -->
9280
</slide>
9381

94-
<slide class="" id="slide-3" style="background:;">
82+
<slide class="" id="slide-3" style="background:;">
9583
<hgroup>
9684
<h2>The empirical mean</h2>
9785
</hgroup>
98-
<article>
86+
<article data-timings="">
9987
<ul>
10088
<li>Define the empirical mean as
10189
\[
@@ -105,9 +93,8 @@ <h2>The empirical mean</h2>
10593
\[
10694
\tilde X_i = X_i - \bar X.
10795
\]
108-
The the mean of the \(\tilde X_i\) is 0.</li>
96+
The mean of the \(\tilde X_i\) is 0.</li>
10997
<li>This process is called &quot;centering&quot; the random variables.</li>
110-
<li>The mean is a measure of central tendancy of the data.</li>
11198
<li>Recall from the previous lecture that the mean is
11299
the least squares solution for minimizing
113100
\[
@@ -119,11 +106,11 @@ <h2>The empirical mean</h2>
119106
<!-- Presenter Notes -->
120107
</slide>
121108

122-
<slide class="" id="slide-4" style="background:;">
109+
<slide class="" id="slide-4" style="background:;">
123110
<hgroup>
124111
<h2>The emprical standard deviation and variance</h2>
125112
</hgroup>
126-
<article>
113+
<article data-timings="">
127114
<ul>
128115
<li>Define the empirical variance as
129116
\[
@@ -133,22 +120,19 @@ <h2>The emprical standard deviation and variance</h2>
133120
<li>The empirical standard deviation is defined as
134121
\(S = \sqrt{S^2}\). Notice that the standard deviation has the same units as the data.</li>
135122
<li>The data defined by \(X_i / s\) have empirical standard deviation 1. This is called &quot;scaling&quot; the data.</li>
136-
<li>The empirical standard deviation is a measure of spread.</li>
137-
<li>Sometimes people divide by \(n\) rather than \(n-1\) (the latter
138-
produces an unbiased estimate.)</li>
139123
</ul>
140124

141125
</article>
142126
<!-- Presenter Notes -->
143127
</slide>
144128

145-
<slide class="" id="slide-5" style="background:;">
129+
<slide class="" id="slide-5" style="background:;">
146130
<hgroup>
147131
<h2>Normalization</h2>
148132
</hgroup>
149-
<article>
133+
<article data-timings="">
150134
<ul>
151-
<li>The the data defined by
135+
<li>The data defined by
152136
\[
153137
Z_i = \frac{X_i - \bar X}{s}
154138
\]
@@ -163,11 +147,11 @@ <h2>Normalization</h2>
163147
<!-- Presenter Notes -->
164148
</slide>
165149

166-
<slide class="" id="slide-6" style="background:;">
150+
<slide class="" id="slide-6" style="background:;">
167151
<hgroup>
168152
<h2>The empirical covariance</h2>
169153
</hgroup>
170-
<article>
154+
<article data-timings="">
171155
<ul>
172156
<li>Consider now when we have pairs of data, \((X_i, Y_i)\).</li>
173157
<li>Their empirical covariance is
@@ -176,8 +160,6 @@ <h2>The empirical covariance</h2>
176160
\frac{1}{n-1}\sum_{i=1}^n (X_i - \bar X) (Y_i - \bar Y)
177161
= \frac{1}{n-1}\left( \sum_{i=1}^n X_i Y_i - n \bar X \bar Y\right)
178162
\]</li>
179-
<li>Some people prefer to divide by \(n\) rather than \(n-1\) (the latter
180-
produces an unbiased estimate.)</li>
181163
<li>The correlation is defined is
182164
\[
183165
Cor(X, Y) = \frac{Cov(X, Y)}{S_x S_y}
@@ -190,11 +172,11 @@ <h2>The empirical covariance</h2>
190172
<!-- Presenter Notes -->
191173
</slide>
192174

193-
<slide class="" id="slide-7" style="background:;">
175+
<slide class="" id="slide-7" style="background:;">
194176
<hgroup>
195177
<h2>Some facts about correlation</h2>
196178
</hgroup>
197-
<article>
179+
<article data-timings="">
198180
<ul>
199181
<li>\(Cor(X, Y) = Cor(Y, X)\)</li>
200182
<li>\(-1 \leq Cor(X, Y) \leq 1\)</li>
@@ -209,34 +191,77 @@ <h2>Some facts about correlation</h2>
209191

210192
<slide class="backdrop"></slide>
211193
</slides>
212-
213-
<!--[if IE]>
194+
<div class="pagination pagination-small" id='io2012-ptoc' style="display:none;">
195+
<ul>
196+
<li>
197+
<a href="#" target="_self" rel='tooltip'
198+
data-slide=1 title='Some basic definitions'>
199+
1
200+
</a>
201+
</li>
202+
<li>
203+
<a href="#" target="_self" rel='tooltip'
204+
data-slide=2 title='Notation for data'>
205+
2
206+
</a>
207+
</li>
208+
<li>
209+
<a href="#" target="_self" rel='tooltip'
210+
data-slide=3 title='The empirical mean'>
211+
3
212+
</a>
213+
</li>
214+
<li>
215+
<a href="#" target="_self" rel='tooltip'
216+
data-slide=4 title='The emprical standard deviation and variance'>
217+
4
218+
</a>
219+
</li>
220+
<li>
221+
<a href="#" target="_self" rel='tooltip'
222+
data-slide=5 title='Normalization'>
223+
5
224+
</a>
225+
</li>
226+
<li>
227+
<a href="#" target="_self" rel='tooltip'
228+
data-slide=6 title='The empirical covariance'>
229+
6
230+
</a>
231+
</li>
232+
<li>
233+
<a href="#" target="_self" rel='tooltip'
234+
data-slide=7 title='Some facts about correlation'>
235+
7
236+
</a>
237+
</li>
238+
</ul>
239+
</div> <!--[if IE]>
214240
<script
215241
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
216242
</script>
217243
<script>CFInstall.check({mode: 'overlay'});</script>
218244
<![endif]-->
219245
</body>
220-
<!-- Grab CDN jQuery, fall back to local if offline -->
221-
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
222-
<script>window.jQuery || document.write('<script src="../../libraries/widgets/quiz/js/jquery-1.7.min.js"><\/script>')</script>
223-
<!-- Load Javascripts for Widgets -->
224-
<!-- MathJax: Fall back to local if CDN offline but local image fonts are not supported (saves >100MB) -->
225-
<script type="text/x-mathjax-config">
226-
MathJax.Hub.Config({
227-
tex2jax: {
228-
inlineMath: [['$','$'], ['\\(','\\)']],
229-
processEscapes: true
230-
}
231-
});
232-
</script>
233-
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
234-
<!-- <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
235-
</script> -->
236-
<script>window.MathJax || document.write('<script type="text/x-mathjax-config">MathJax.Hub.Config({"HTML-CSS":{imageFont:null}});<\/script><script src="../../libraries/widgets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"><\/script>')
246+
<!-- Load Javascripts for Widgets -->
247+
248+
<!-- MathJax: Fall back to local if CDN offline but local image fonts are not supported (saves >100MB) -->
249+
<script type="text/x-mathjax-config">
250+
MathJax.Hub.Config({
251+
tex2jax: {
252+
inlineMath: [['$','$'], ['\\(','\\)']],
253+
processEscapes: true
254+
}
255+
});
256+
</script>
257+
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
258+
<!-- <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
259+
</script> -->
260+
<script>window.MathJax || document.write('<script type="text/x-mathjax-config">MathJax.Hub.Config({"HTML-CSS":{imageFont:null}});<\/script><script src="../../librariesNew/widgets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"><\/script>')
237261
</script>
238262
<!-- LOAD HIGHLIGHTER JS FILES -->
239-
<script src="../../libraries/highlighters/highlight.js/highlight.pack.js"></script>
240-
<script>hljs.initHighlightingOnLoad();</script>
241-
<!-- DONE LOADING HIGHLIGHTER JS FILES -->
242-
</html>
263+
<script src="../../librariesNew/highlighters/highlight.js/highlight.pack.js"></script>
264+
<script>hljs.initHighlightingOnLoad();</script>
265+
<!-- DONE LOADING HIGHLIGHTER JS FILES -->
266+
267+
</html>

0 commit comments

Comments
 (0)