Hank Ibser Statistics 20 Spring 2016
The final will be Tuesday, May 10, B-llam, in TWO rooms: Wheeler Auditorium
and 100 Lewis. Minh Nguyen's and Amy Bray's students in 100 Lewis, everyone
else in Wheeler. Please plan to arrive a bit early so we can start
Summary Statistics, Ch 4-5
average (or mean) = sum of entries / number of entries
SD = rms of deviations from average
SU = (value - average)/SD
Correlation and Regression, Ch 8-12
r = average of (x in SU)(y in SU)
prediction error = actual value
- predict
#Lecture Thirteen: Bootstrap
#Illustrating Bootstrap
#Suppose I have n = 100 observations from some distribution.
n = 100
xx = 6 + rt(n, 2)
#I would like to estimate the median of the distribution F (in this case, the
median happens to be 6)
#I would like
setwd("/Users/aditya/Dropbox/Berkeley Teaching/151A 2016 FALL Linear Models")
#Examples of Datasets
#Bodyfat Data: saved as BodyFat.csv in the folder.
#Explanation of the dataset at http:/lib.stat.cmu.edu/datasets/bodyfat
body = read.csv("BodyFat.csv", he
#Lecture Six (Regression terminology, fitted values, residuals etc.)
#When X^T X is not invertible.
#Consider the body fat dataset
body = read.delim("bodyfat_corrected.txt", header = TRUE, sep = ")
head(body, 10)
#Let us fit a linear model for BODYFAT usi
#R code for the Eighth lecture on September 20
body = read.delim("bodyfat_corrected.txt", header = TRUE, sep = ")
head(body, 10)
#Linear Model Fitting
mod1 = lm(BODYFAT ~ AGE + WEIGHT + HEIGHT + THIGH, data = body)
summary(mod1)
#Illustration of t-values
#Lecture Three on 1 Sept, 2016
#setwd("/Users/aditya/Dropbox/Berkeley Teaching/151A 2016 FALL Linear Models")
#Load the Pearson Father-Son Height data.
height = read.table("PearsonHeightData.txt", header = T)
dim(height)
head(height)
plot(Son ~ Father, da
A Graph for the Economist
stat 133
February 17, 2016
The Economist is a well-regarded weekly news magazine. The following graphic accompanied their article
about the release of the College Scorecard data in Sept. 2015.
I Scorecard
Waumstpu'yantUSoollegas'
Holiday Birthdays
Stat 133
February 8, 2016
In this activity, youre going to examine how the number of daily births in the US varies over the years.
Births each day
The data table Birthdays in the mosaicData package gives the number of births recorded on
Statistics 133 -Writing Functions in R
1. Write a function that takes a number year and returns a logical value which is either
TRUE, if the year was or will be a leap year, or FALSE if not. The rule for determining
leap years is that one of the following
Answers to Review Exercises
Part I. Design of Experiments
Chapter 2. Observational Studies
1. (a) Too hasty. What about population size?
Comments: Michigan may include the big bad city, but Minnesota has
twice the population of Michigan. The crime rate is
Assignment 6
Pg. 94
#3a.) Approximately 25%
3b.) Approximately 10%
Pg. 95
#7a.) 95th percentile. 1 standard deviation away would be 100, but they were more
than that and falling in 2 standard deviations away puts you in the 90th percentile
range
#7b.) Bet
Statistics Notes:
Chapter 1: Controlled Experiments
I.
II.
Vocab
a. Method of Comparison: Statisticians like to use this method because it
allows them to compare two groups and see the results
b. Treatment Group: The group that receives the treatment (X)
Assignment 19
page 286
9.) Choice ii (B gives a better chance of winning). In B 200 draws are made from the
box, and with a greater number of draws, the percentage of red drawn is more likely
to be close to the amount in the box. Since you have more red i
Assignment 5
Pg. 65
#5.) Average Age: The majority of students would fall under a certain age bracket,
but it would still have a right tail because there would be some outliers who are
extremely old; ex: Maybe students who had kids, and then returned back
Assignment 8
Pg. 132
4a.) Yes, it is on the SD line; 2 Standard Deviations above average weight & 2
Standard Deviations above average weight
pg. 134
#1a.)
Average X = 28/7 = 4
Average Y = 4
SDx = 1-4 = -3
2-4=-2
3-4=-1
4-4=0
5-4=1
6-4=2
7-4=3
SDx = Square
Assignment #9
Pg. 143
#4.) R stays the same even if you double each value of X
Pg. 144
#9.) The person who calculates it for the whole year will have the larger correlation
because of attenuation
Pg. 153
#5, Set E.) No you should not conclude that coffee
Physics 112, Fall 2013: Midterm Review Questions
Philipp T. Dumitrescu
University of California, Berkeley
(October 1, 2013)
Note: These problems do not provide exhaustive coverage of the material. They may
not be representative of what might be on the exa
Physics 112, Fall 2013: Problem Set 3
Philipp T. Dumitrescu
University of California, Berkeley
(September 27, 2013)
Note: This is a generalisation of the ideal gas in 3D; the idea is that you go through the
micro-canoncial ensemble calculation yourself an
CS170 Discussion Section 3
September 18/19, 2013
Solutions
1. Practice with FFT (Problem 2.8).
a) Since we have 4 coefficients, n = 4 = = e(2)/4 = i. (a0 , a1 , a2 , a3 ) = (1, 0, 0, 0), so
A(x) = 1+0x+0x2 +0x3 = 1. Thus, the FFT of (1, 0, 0, 0) is (A( 0
#R code for the Ninth Lecture on September 26
#Taken from Julian Faraway's book (Chapter 3) on Linear Models with R
library(faraway)
data(savings)
names(savings)
help(savings)
g = lm(sr ~ pop15 + pop75 + dpi + ddpi, data = savings)
summary(g)
#Hypothesis
#R code for the Eighth lecture on September 24
body = read.csv("BodyFat.csv", header = TRUE)
head(body, 10)
#Linear Model Fitting
mod1 = lm(BODYFAT ~ AGE + WEIGHT + HEIGHT + THIGH, data = body)
summary(mod1)
#Illustration of t-values and the corresponding
#R code for the sixth lecture on September 17
body = read.csv("BodyFat.csv", header = TRUE)
head(body, 10)
#Linear Model Fitting
mod1 = lm(BODYFAT ~ AGE + WEIGHT + HEIGHT + THIGH, data = body)
summary(mod1)
#Illustrating fitted values
names(mod1)
mod1$fit