Beruflich Dokumente
Kultur Dokumente
Lecture 1 Outline
Stat 139
Prereqs:
Phone numbers:
1/25/2015
Teaching Staff
Course Website
Course website:
https://canvas.harvard.edu/courses/2421
Syllabus
Administrative Announcements
Lecture Notes
R Tutorial (including download and install
instructions)
Assigned Homeworks
HW #1
Other Study Material (practice exams, web links,
etc...)
6
5
Class Meetings
Lecture Notes
Lectures:
Sections
Optional (but strongly recommended) weekly section to
discuss homework, do extra problems, and review
difficult concepts.
Held mostly Wed, and Thurs afternoons
No sections this week (begin week of Feb. 2).
Look for announcement on the course website for
permanent times (OHs too).
lecture after this week (we will provide copies on Wed and
Fri).
They will loosely follow the order of the text, and will
reference specific sections in the text.
Lecture notes will be posted online at least 24 hours in
advance. An email will be sent when they are posted.
Notes are very concise you are encouraged to add your
own annotations and develop your own notes.
Occasionally mistakes appear in lecture notes; corrected
versions will be posted after class.
8
1/25/2015
Recommended Textbook
R Software (+ RStudio)
(not required)
R Help Guides
10
Exams
An Introduction to R by LH Lam
Comprehensive introduction to R:
http://cran.r-project.org/doc/manuals/R-intro.pdf
12
11
1/25/2015
Homeworks
HW Collaboration
Friday
HW #1 will be posted soon, and will be due Friday,
Feb. 6
boxes.
14
Course Grading
Lecture 1 Outline
Component
Weight1
Weight2
Weight3
Homework
30%
30%
30%
Project
15%
15%
15%
Midterm
20%
5%
20%
Midterm
5%
20%
20%
Final Exam
30%
30%
15%
Your overall score for the course will be the highest of the 3 weighting
schemes presented above. Final course letter grades are not assigned
Total
100%
100%
100%
according to
a fixed percentages
of A's, B's,
etc
15
16
1/25/2015
Urban dictionary:
To play the role of detective, to gather facts and
information usually in the traditional Sherlock
Holmes inconspicuous way.
A proper Sleuth needs to be intelligent, witty, and
always a few steps ahead others. . His wisdom
is his greatest asset.
18
1/25/2015
Lecture 1 Outline
22
A quick R demonstration
24
1/25/2015
Lecture 1 Outline
26
An R Demonstration
A quick R demonstration
28
1/25/2015
An R Demonstration (cont.)
f = file.choose()
data = read.csv(f)
n = dim(data)[1]
data$maxtemp = data$Max.TemperatureF
winter15=data[data$Date >= "2015-0101",]
winter14=data[data$Date >= "2014-01-01"
& data$Date <= (data$Date[n]-365),]
# Visualize the data
boxplot(winter14$maxtemp,winter15$maxtem
p,col=c("rosybrown","green3"))
# As a 2-sample unpooled t-test
t.test(winter14$maxtemp,winter15$maxtemp
)
# As a 2-sample pooled t-test
t.test(winter14$
maxtemp,winter15$maxtemp, var.equal=T)
# As a 2-sample paired t-test
t.test(winter14$Max.TemperatureF
,winter15$Max.TemperatureF, paired=T)
# As a Resampled test
diff.obs=mean(winter14$maxtemp)mean(winter15$maxtemp)
combined.sample=c(winter14$maxtemp,
winter15$maxtemp)
nsims=10000
diff.sim=rep(NA,nsims)
for(i in 1:nsims){
resampled.temp=sample(combined.sample,le
ngth(combined.sample))
diff.sim[i]=mean(resampled.temp[1:length
(winter14$maxtemp)])mean(resampled.temp[(length(winter14$max
temp)+1):length(combined.sample)])
}
mean(abs(diff.sim)>abs(diff.obs))
29