Stat 431/831
ASSIGNMENT 2
Due: 12pm Noon Oct 31, 2014
Your assignment must be handed in before the due time in the drop boxes. Include all R code
and relevant output. Be sure to use the cover page provided in Learn.
1. (Assigned last time) A sample of 827
A3 Spring 2014, Stat 431
Instructor: Dr. Schonlau
Wednesday, July 2, 12:00 a.m. (noon), Box 14 Dropbox , 4th floor MC.
[Total marks 46]
Q1 [23 marks] Claims
In this exercise we will look at some data from Baxter et al. (1980) Transactions 21 Congress of A
STAT 431
ASSIGNMENT 3
DUE: MARCH 07, 2012
1. Suppose a sample of independent counts y1 , . . . , yn is available. Let f0 , f1 , . . . , fK denote the
observed frequencies of 0, 1, 2, . . . , K counts, respectively, where for convenience, if y K
we denote
University of Waterloo
Final Examination
Term: Fall
Year: 2010
Student Name:
Student ID Number:
Course Abbreviation and Number
STAT 431
Course Title
Generalized Linear Models and their
Applications
Section(s)
001
Sections Combined Course(s)
NA
Section Num
Stat 431
Question 1
ASSIGNMENT 4 SOLUTIONS - DUE APRIL 2, 2012
(a) There are many ways one could think about trying to obtain the best model. We rst start
by tting models where the covariates salinity, temperature and O2 are considered continuous.
Let i b
Log-linear Models for Contingency Tables
March 5, 2012
0.1
Using Log-linear Models for Contingency Tables
We can use log-linear models to analyze data coming from multinomial or product multinomial designs. The log-linear models under the null hypothesis
Classication study - Melanoma Study
A cross-sectional study was conducted in y . = 400 patients with
malignant melanoma who were classied according to two factors,
the site of the tumour and the histological type. The data are as
follows.
Tumour Type (i)
Longitudinal and Clustered Data
Oana Danila
April 1, 2012
Overview
In the last chapter, we discussed cases where the variability in the data was larger than
what could be explained by the covariates at hand and by the chosen distributions from the
exponen
STAT 431
Generalized Linear Models and Applications
Midterm Examination
Fall 2010
Student Name:
UW Student ID Number:
Instructor:
Cecilia Cotton
Date of Exam:
October 26, 2010
Time Period:
Start time: 4:30 pm
Duration of Exam:
1 hour, 50 minutes
Number of
STAT 431
SKETCH SOLUTIONS OF TERM EXAM 2
MARCH 14, 2012
1. (a) For any subject, the tolerance is the level of intensity (i.e. dose) below which the response
will not occur and above which it will occur.
(b) Suppose the tolerance has a logistic distributio
Stat 431/831
TERM TEST 2 SOLUTIONS
Question 1
[20/25 marks]
(a) Here we are modelling the death counts (ij ) in various age and smoking groups: [4 marks]
log(ij ) = log(ij ij ) = log ij + log ij = x + log(ij )
It is important to include the oset term beca
Stat 431/831
TERM TEST 2 SOLUTIONS
Question 1
[20/25 marks]
(a)
[4 marks]
For a time homogeneous poisson process we set i = i ti . Based on the log link we therefore
have:
log(i ) = log(1 ) + log(ti ) = xT + log(ti )
i
The oset is the log(ti ) term and is
Stat 431/831
ASSIGNMENT 3 - SOLUTIONS
1. [15 points]
(a) [5 points] The likelihood for the data from the British for the most general multinomial
model is
y. !
P (Yij = yij , i = 1, . . . , 5; j = 1, . . . , 5|Y. = y. ) =
i
where ij =
ij
.
and
i
j
j
y
yij
Overdispersion
Oana Danila
April 1, 2012
0.1
Overdispersion
Overdispersion arises when there is more variability in the data that we would expect from
the tted model. If we cannot improve the t by introducing new covariates, interaction
terms or by consid
Overview of Generalized Linear Models
April 2, 2012
Overview of the Course
Regression analysis is the study of the relationship between a response (outcome,
dependent) variable and one or more predictors (explanatory, independent) variables
(covariates).
A3 Spring 2014, Stat 431
Instructor: Dr. Schonlau
Wednesday, July 2, 12:00 a.m. (noon), Box 14 Dropbox , 4th floor MC.
[Total marks 46]
Be sure to include all relevant output for all questions of this assignment. Be kind to your TA, don't make
them search
Stat 431/831
ASSIGNMENT 1 SOLUTIONS
1. Recall that you were given the likelihood:
n
f (ti ; )i [1 F(ti ; )](1i )
L(; t, ) =
i=1
(a) Since the Ti are exponentially distributed we know that the pdf and cdf are given by:
f (t; ) = exp(ti )
1 F(t, ) = P [Ti >
Stat 431/831
TERM TEST 1 SOLUTIONS
Question 1
[12 marks]
(a) Manipulating the given pdf we have:
[5 marks]
4 2t/
te
2
2t
= exp
log 2 + log(4t)
2
2 log + log(4t)
= exp t
1
t + log
= exp
+ log(4t)
1/2
t0
f (t) =
The above (actually a gamma distribution)
Stat 431/831
ASSIGNMENT 3
Due: November 11, 2010
Midterm Grade Recovery
Those students wishing to improve on their midterm exam performance may take advantage of the
following opportunity to gain up to 50% of the grades originally lost on the midterm.
To
Stat 431/831
1. (a)
ASSIGNMENT 4 SOLUTIONS
i. Because Yi1 , Yi2 , Yi3 and Yi4 are conditionally independent given ui , i = 1, . . . , 59,
the joint distribution of Yi1 , Yi2 , Yi3 and Yi4 is
P (Yi1 = yi1 , Yi2 = yi2 , Yi3 = yi3 , Yi4 = yi4 )
4
p(yij |ui
Stat 431/831
ASSIGNMENT 4
Due: November 25, 2010
Consider the Epilepsy Trial data from the notes (available for download as epi.dat.txt from the
course website). The number of epileptic seizures occurring during an initial 8 week observation
period and th
Problem 1 [20 marks]
(a) The main eects model is given by:
[5 marks]
logit (P [fever = 1]) = 0 +1 age+2 mosnet+3 sector2+4 sector3+5 sector4+6 sector5
We are interested in testing:
H0 : 2 = 0
versus
Ha : 2 = 0
The test statistics is given by:
0.333525
2 0
University of Waterloo
Final Examination
Term: Fall
Year: 2009
Student Name:
UW Student ID Number:
Course Abbreviation and Number:
STAT 431/831
Course Title:
Generalized Linear Models and Applications
Section(s):
001
Sections Combined Course(s):
N/A
Secti
STAT 431
ASSIGNMENT 3
DUE: MARCH 7, 2012
1. (a) Let Yi be number of repairs required for an army vehicle i over a ten-year period. The
null hypothesis can be stated in terms of the distributional assumption that:
k = P (Yi = k) =
k e
,
k!
k = 0, 1, 2, . .
STAT 431
ASSIGNMENT 4
DUE: MONDAY, APRIL 02, 2012
1. To learn about the importance of salinity, temperature, and oxygen concentration on the
probability of hatching for eggs from Pacic cod sh, the following experiment was conducted.
Salinity (measured in
Stat 431/831
ASSIGNMENT 3 SOLUTIONS
1. (a) Under a time homogenous Poisson model we would have Yi Poisson(ti ), i = 1, . . . , 32,
and the log-likelihood would be
32
yi log ti
() =
i=1
where ti is the length of fabric piece i and yi is the observed number
STAT 431/831 - FINAL EXAM - FALL 2011
Question 1 [15 marks]
A study was conducted to determine the compressive strength of an alloy fastener used in the
construction of aircraft. Ten pressure loads, increasing in units of 200 psi from 2500 psi to 4300 psi
Stat 431/831
ASSIGNMENT 2 - SOLUTIONS
1. [15 points]
(a) [4 points] We want to test the hypothesis that the eect of uoridation does not depend
on social class. We rst read the data and create relevant variables:
teeth.dat
fluoride class y
m classf classft
Logistic regression : Reduced
models and residuals
Matthias Schonlau
Overview
Goodness of Fit (GoF) tests
Model selection
Residuals
Goodness of Fit (GoF)
Does the model fit the data well?
The quality of the fit is judged by how well the
estimated res
Eikosograms
3-way Contingency Tables
STAT 431: Generalized Linear Models
Winter 2017
Lecture 15: Eikosograms and Log Linear Models for
3-way Contingency Tables
Instructor: Cecilia A. Cotton
Department of Statistics & Actuarial Science
University of Waterl
Poisson Approx to Binomial
Example: Skin Cancer
Time Non homogeneous Poisson Processes
Example: Rat Tumors
STAT 431: Generalized Linear Models
Winter 2017
Lecture 12: Log Linear Models (Continued)
Instructor: Cecilia A. Cotton
Department of Statistics & A
Analysis of Contingency Tables
The Multinomial Distribution
The Product Multinomial Distribution
STAT 431: Generalized Linear Models
Winter 2017
Lecture 13: Analysis of Contingency Tables (Introduction)
Instructor: Cecilia A. Cotton
Department of Statisti
Log Linear Models for 2-way Tables
Example: A Melanoma Study
Example: Self-Examination Data
STAT 431: Generalized Linear Models
Winter 2017
Lecture 14: Log Linear Models for Contingency Tables
Instructor: Cecilia A. Cotton
Department of Statistics & Actua