Homework One
Statistics 151a (Linear Models)
Due on 16 September, 2015
06 September, 2015
1. Consider simple linear regression where there is one response variable y and an
explanatory variable x and there are n subjects with values y1 , . . . , yn and x1
Stat 151a Linear Models
Homework 3 Solutions
October 14, 2015
1. For an orthonormal set u1 , . . . , un we will freely use the observation (which you should be familiar with
by now) that
(
1 if i = j
T
(ui , uj ) = ui uj =
0 if i 6= j
n
(a) Since u1 , . .
Stat 151 Fall 2015
Homework 1 Solutions
September 17, 2015
1. (a)
0 = y 1 x
P
Cov(x, y)
(xi x
)(yi y)
P
=
(xi x
)2
Var(x)
1 =
(b)
P
0 = x
1 y
1 =
(xi x
)(yi y)
Cov(x, y)
P
=
(yi y)2
Var(y)
(c) From the above expressions we see that
(Cov(x, y)2
1 1 =
1
V
Stat 151a Linear Models
Homework 2 Solutions
October 5, 2015
1. Defining a = (a1 , . . . , an ), we have from the question E(aT y) = 1 . Since E(y) = X, we have
aT X = 1
or another way of writing the same thing,
(X T a)T = 1
Defining a new vector c as X T
Midterm One
Statistics 151, Fall 2013
08 October, 2013
1. Last year, 80 students took this particular course at Berkeley of whom 20 were freshmen, 20 were
sophomores, 20 juniors and 20 seniors. In R, I have saved the scores for the 20 freshmen in the
vect
Midterm Two - Statistics 151a, Fall 2015
Due on 24 November, 2015
17 November, 2015
1
Resources
You must not consult any person or resource (online or otherwise) for your analysis. If you have any
clarification questions about the data etc., you may conta
STAT 151A - Linear Models - Lecture Six
Fall 2015, UC Berkeley
Aditya Guntuboyina
15 September, 2015
1 Fitting linear regression to regression data
We have a response vector Y which is n 1 and contains all the values of the response
variable. We also have
Statistics 151A: Generalized Linear Models
Solution to Assignment 3: Due March 10th
Please submit FIVE files. A SID assignment 3.pdf which contains the solution to the
non-coding problems, a SID assignment 3-lab.pdf which contains your lab report, a
SID a
Homework Five
Statistics 151a (Linear Models)
Due on 18 November 2015
06 November, 2015
1. In the Bodyfat dataset, consider the linear model
BODYFAT = 0 + 1 AGE + 2 WEIGHT + 3 HEIGHT + 4 THIGH + e
In R, plot the following graphs (9 points = one for each g
Fall 2013 Statistics 151 (Linear Models) : Lecture Six
Aditya Guntuboyina
17 September 2013
We again consider Y = X + e with Ee = 0 and Cov(e) = 2 In . is estimated by solving the normal
equations X T X = X T Y .
1
The Regression Plane
If we get a new sub
Homework Two
Statistics 151a (Linear Models)
Due on 30 September 2015
21 September, 2015
1. Consider the linear model Y = X + e with = (0 , 1 , . . . , p )T . Suppose I can
find real numbers a1 , . . . , an such that
E (a1 Y1 + . . . an Yn ) = 1 .
Show th
STAT 151A Linear Modeling
Homework 1 Solution
March 5, 2016
Problem 1
and SY = SX .
Suppose that the means and standard deviations of Y and X are the same: Y = X
(a) Show that under these circumstances,
BY |X = BX|Y = rXY
where BY |X is the least-squares
f6753bb27ebd36df66ed3c8aaaa7af94359c5586
state
AL
AK
AZ
AR
CA
CO
CT
DE
DC
FL
GA
HI
ID
IL
IN
IA
KS
KY
LA
ME
MD
MA
MI
MN
MS
MO
MT
NE
NV
NH
NJ
NM
NY
NC
ND
OH
OK
OR
PA
RI
SC
SD
TN
TX
UT
VT
VA
WA
WV
WI
WY
region population satVerbal satMath percentTaking perce
Fall 2013 Statistics 151 (Linear Models) : Lecture Seven
Aditya Guntuboyina
19 September 2013
1
Last Class
We looked at
1. Fitted Values: Y = X = HY where H = X(X T X)1 X T Y . Y is the projection of Y onto the
column space of X.
2. Residuals: e = Y Y = (
DUMMY-VARIABLE REGRESSION
Objective:
Incorporation of qualitative explanatory variables (factors) in conjunction with or without
quantitative variables in a linear model.
The usage of dummy variable repressors coded as dichotomous (two sub groups) and
pol
LECTURE 1 Linear Statistical Modelling and Social Science
Objectives:
To differentiate between social reality and statistical models that represent social realities.
To juxtapose/expound the advantages and disadvantages of observational and experimental
s
Fall 2013 Statistics 151 (Linear Models) : Lecture Twelve
Aditya Guntuboyina
10 October 2013
1
Regression Diagnostics
We now talk about regression diagnostics. I follow the treatment in Christensens book (Plane Answers
to Complex Questions), Chapter 13 ve
Statistics 151a - Linear Modelling: Theory and
Applications
Adityanand Guntuboyina
Department of Statistics
University of California, Berkeley
29 August 2013
1 / 25
The Regression Problem
This class deals with the regression problem where the goal is to
u
Fall 2013 Statistics 151 (Linear Models) : Lecture Four
Aditya Guntuboyina
10 September 2013
1
Recap
1.1
The Regression Problem
There is a response variable y and p explanatory variables x1 , . . . , xp . The goal is understand the relationship between y
Fall 2013 Statistics 151 (Linear Models) : Lecture Five
Aditya Guntuboyina
12 September 2013
1
Least Squares Estimate of in the linear model
The linear model is
with Ee = 0 and Cov(e) = 2 In
Y = X + e
where Y is n 1 vector containing all the values of the
Fall 2013 Statistics 151 (Linear Models) : Lecture Eighteen
Aditya Guntuboyina
31 October 2013
1
Criteria Based Variable Selection
If there are p explanatory variables, then there are 2p possible linear models. In criteria-based variable
selection, we t a
Midterm Two - Statistics 151a, Spring 2015
Due on April 23, 2015
14 April, 2015
1
Resources
You must not consult any person or resource (online or otherwise) for your analysis. If you have any
clarification questions about the data etc., you may contact P
Spring 2016 Statistics 151 Midterm Review Notes
Adapted from the notes of Aditya Guntuboyina with input from Omid Shams
March 16, 2016
1
Estimation in the Linear Model
The quantities = (0 , 1 , . . . , p ) and 2 > 0 are parameters in the linear model. The
Practice Problems
Stat 151A, Spring 2014
1. For each statement below, indicate whether it is TRUE or FALSE and give your
reasoning
(a) The OLS estimator of in a linear regression model is unbiased even if
the errors in the model are dependent.
(b) The sum
Midterm Review Exercises
STAT151A, SPRING 2016
1. For each statement below, indicate whether it is TRUE or FALSE and give your reasoning.
(a) In K-fold cross validation, you split your sample into subsamples of size K.
(b) For OLS, the sum of the residual
Fall 2013 Statistics 151 (Linear Models) : Lecture Three
Derek Bean
05 September 2013
1
Linear Algebra Review, contd
Result: for matrix A, rank(A) + dim(K(A) = no. of columns in A.
Denition: Matrix A is full rank if rank(A) = no. of columns in A (i.e. d
Homework 7
R Markdown
longData = read.table("C:/Users/Wideet/Downloads/Long.txt")
15.1
1.
plot(density(longData$art)
plot(density(log(longData$art)
plot(density(sqrt(longData$art)
Based on the density curves, we can see that the data is right skewed in it
LAB
USE EITHER OF THE DATA and do these questions by hand. Use a calculator to complete
tables and answer the following questions:
Example Is the number of hours of work in a student life affecting the number of time spent with
family in a day.
X
Y
2
3
1
Species Extinction Heat Map
R Markdown
state_data = read.csv("C:/Users/Wideet/Stat 151/Homework/HW 6/States.csv")
a)
X = as.matrix(cbind(1, state_data$satMath, state_data$percentTaking)
Y = as.matrix(state_data$teacherPay)
beta.hat = solve(t(X)%*%X)%*%t(X
Species Extinction Heat Map
R Markdown
state_data = read.csv("C:/Users/Wideet/Stat 151/Homework/HW 6/States.csv")
a)
X = as.matrix(cbind(1, state_data$satMath, state_data$percentTaking)
Y = as.matrix(state_data$teacherPay)
beta.hat = solve(t(X)%*%X)%*%t(X