STAT 425 Spring 2015
Homework 5
(Posted on March 20; Due Friday April 3)
Please submit your assignment on paper, following the Guidelines for Homework posted at the
course website. (Even if correct, answers might not receive credit if they are too dicult
STAT 425 Spring 2015
Homework 7
(Posted on April 19; Due Friday May 1)
Please submit your assignment on paper, following the Guidelines for Homework posted at the
course website. (Even if correct, answers might not receive credit if they are too dicult to
STAT 425, Spring 2015
Homework 7 Solution
Problem 1
(a)
Fit a logistic regression:
> attach(aflatoxin)
> mod_af_logit <- glm(cbind(tumor, total-tumor) ~ dose, family = bin
omial, data = aflatoxin)
> summary(mod_af_logit)
Call:
glm(formula = cbind(tumor, t
STAT 425, Spring 2015
Homework 6 Solution
1. a) First we fit the full interaction model:
> library(faraway)
> attach(butterfat)
> ?butterfat
> mod=lm(Butterfat~Breed*Age)
> anova(mod)
Analysis of Variance Table
Response: Butterfat
Df Sum Sq Mean Sq F valu
STAT 425 Lecture Notes
Block Designs
Spring 2015
Blocking and Randomization
Recall: In a comparative experiment, treatments are assigned
to experimental units, and responses are observed.
A major analytical limitation is experimental error : the degree
to
STAT 425 Lecture Notes
Model Selection
Spring 2015
Consider two models (with the usual assumptions):
Y =
0
+
1 X1
+
2 X2
+
1 X1
+"
+"
(1)
and
Y =
0
(2)
Model (2) is obtained by dropping X2 from model (1).
Lets assume that model (1) is fully correct, and e
STAT 425 Lecture Notes
Homogeneity of Regressions
(ANCOVA Model)
Spring 2015
Categorical Predictors and Dummy Variables
Dummy variables can be used to include categorical
variables in a linear regression analysis.
Consider the melanoma data:
Previously, w
STAT 425 Lecture Notes
Factorial Structure
Spring 2015
Two-Way Factorials
The data set we will examine consists of the survival times of
animals randomly allocated to three poisons (I, II, III) and four
treatments (A, B, C, D).
The arrangement used is cal
STAT 425 Lecture Notes
Problems with the Error
Spring 2015
Generalized Least Squares
So far, we have only considered the case where the Y s have
equal variances and are uncorrelated. This follows from the
assumption
var() = 2 I
What if this assumption is
STAT 425 Course Notes
Estimation in Linear Regression
Spring 2015
Multiple Regression
So far we have only considered simple linear regression (only
one predictor). More generally, consider several predictors .
Let X1 , X2 , ., Xp be p predictors of a resp
STAT 425 Course Notes
Introduction:
Simple Linear Regression
Spring 2015
Is This Course For You?
Yes, if you .
have taken STAT 410 (or equivalent)
remember your vector calculus and basic linear algebra
know some programming
are interested in learning some
STAT 425 Course Notes
Inference in Linear Regression
Spring 2015
We will consider the following inference tools for a linear
regression model t using least squares:
F -test for model reduction
t-test for an individual model coecient
condence interval for
Tieran Hu
netid: thu12
02/19/2016
1.)
> library(alr4)
> data(stopping)
> names(stopping)
[1] "Speed" "Distance"
> fit <- lm(Distance~Speed, data=stopping)
a.
> plot(fit)
b.
If we look at the normal QQ plot, we can see that the standardized residuals follo
sh is
ar stu
ed d
vi y re
aC s
o
ou urc
rs e
eH w
er as
o.
co
m
Th
https:/www.coursehero.com/file/9974988/midterm1soln/
sh is
ar stu
ed d
vi y re
aC s
o
ou urc
rs e
eH w
er as
o.
co
m
Th
https:/www.coursehero.com/file/9974988/midterm1soln/
sh is
ar stu
ed
STAT 425 Spring 2015
Homework 6
(Posted on April 6; Due Friday April 17)
Please submit your assignment on paper, following the Guidelines for Homework posted at the
course website. (Even if correct, answers might not receive credit if they are too dicult
Exam II Study Problems
1. A randomized, controlled clinical trial was conducted to compare Drug A to Placebo P. The
response variable was
Y = post-treatment score for extent of infection
The predictors were:
X1 = Pre-treatment score for extent of infectio
STAT 425, Sprin 2015
ng
ework 5 So
olution
Home
Pro
oblem 1
a
Bas on the p
sed
plot, we can find that there exists linear rela
n
s
ationship be
etween faft and
fbef for both t
f
treat and co
ontrol group faft valu for trea
ps.
ues
atment grou are gener
up
STAT 425 Lecture Notes
Paired Comparisons
Spring 2015
Matched Pair Experiments
The statistical power to detect group dierences depends on
the variability of the random response variable used to assess
these dierences.
This variability is related to the he
STAT 425 Lecture Notes
Problems with the Predictors
Spring 2015
Predictors Measured with Error
Consider a simple linear regression of Y on X:
Y = 0 + 1 X +
But suppose we dont actually observe X.
Instead, we observe X, which is related to X:
X = X +
The
STAT 425 Lecture Notes
Comparison of T Treatment Means:
One-Way Analysis of Variance
Spring 2015
Some terminology:
A comparative experiment is intended to answer research
questions regarding the dierences between the eects of
imposing two or more dierent
STAT 425 Lecture Notes
Transformations
Spring 2015
Nonlinearity
Lets examine a data set compiled by Allison and Cichetti
(1976), which includes body weight (kg) and brain weight (g)
of 62 species of mammals. (This data is named mammals in
the R package MA
STAT 425 Lecture Notes
Diagnostics in Linear Regression
Spring 2015
Are the model assumptions true? And do we have a stable t?
We cant be certain, but we can at least examine the data for
evidence that the assumptions may be violated and evaluate it
for s