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
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
Review for Stat431
Matthias Schonlau, Ph.D.
Linear regression
Linear regression model
yi xi ' ri
where
xi is a vector of covariates
is a vector of coefficients
ri is a residual
Linear regression
Assumptions include
Normal distribution
yi ~ N ( i , )
2
Stat 431/831
ASSIGNMENT 3
Due: Nov 21, 2014
You need to use the cover page provided in Learn. Include all R code and relevant output.
1. The rst table below presents data collected by a social scientist on inter-generational social
mobility in Britain. Th
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
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 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
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
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
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
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
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
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)
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
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).
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
Stat 431/831
ASSIGNMENT 1
Due: 12pm Oct 3, 2014
Your assignment must be handed in before the due time in the drop boxes. Be sure to use the
cover page provided in Learn.
1. Consider a series of Bernoulli random variables where the probability of success f
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
Stat 431/831
ASSIGNMENT 1 - SOLUTIONS
1. [15 points]
(a) [3 points]
For Y1 , Y2 , . . . , Yn iid with the geometric distribution we have
P (Yi = yi ; ) = (1 )yi
0 < < 1, yi = 0, 1, . . .
The likelihood function is
L(; y) =
n
(1 )yi
i=1
n
= (1 )
The log
Odds ratios (2)
Matthias Schonlau, Ph.D.
Overview
Interpretation / odds ratios
multiple x variables
interaction
Confidence Intervals
Interpretation / odds ratios
more than 1 unit of x
Interpretation of beta
We now set up two indicator variables:
1 i
Logistic regression
link functions
Matthias Schonlau, Ph.D.
Overview
Link functions
Binomial vs Bernoulli regression
Link functions
The expected probability (mean) is linked to a linear
predictor
E (Yi / m) pi
g ( pi ) i
i 0 1 x1
p xp
The identity
Logistic regression
Contrasts
Matthias Schonlau, Ph.D.
Overview
Neuroblastoma interpretation
CIs for Contrasts
Alternative model specification
Neuroblastoma
Neuroblastoma Interpretation
What is the odds ratio of surviving two years for a
patient with
Poisson Regression
Matthias Schonlau, Ph.D.
Overview
Poisson Regression
Offsets
Poisson regression
When the response is a count, Poisson regression
is often appropriate
Number of complaints at a doctors office
Number of military coups in Africa
Number
Contingency Tables
Matthias Schonlau, Ph.D.
Overview
Two-way contingency tables
Equivalence of approaches
2-way Contingency Tables
A 2-way contingency table shows crossclassified data on 2 categorical variables
Outside of academia this is usually refe
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
Poisson Regression
Matthias Schonlau, Ph.D.
Overview
Cargo Ship example
LR tests of multiple vars
Interpretation/ Relative Rates
CIs of contrasts
Estimation
Ship Damage Incidents
Number of times a certain damage incident
occurs in cargo ships
y: #
Contingency Tables
Matthias Schonlau, Ph.D.
Overview
Two-way tables
Multinomial
Product Multinomial
Poisson
2-way Tables
.
2-way Tables - Multinomial
Assume cell frequencies have independent
Poisson distribution.
By conditioning on the grand total w
Contingency Tables
Matthias Schonlau, Ph.D.
Overview
Example 2-way contingency table: Malanoma
Mosaic plots
Interpretation of main effects
Omitting different categories
Example: Calculating Deviance residuals
Melanoma Study
Cross section study with a fix
Kammalcr: Assfjnr'nml' I clue noon Friday
Simple; IOJis-Hc V's-arassron Mods-l
I
log (._.)= Eo+lec|
I "TT'.
5152er 5t. l's binary .c. .1-1'l=cfw_
1W+MFV0+ F15
4n".
x 103( '/1~Tr;)=
._.-'_"
I Grout? l
O are? 0
grout? I VS straw 0
:XFFOS kF =O
[22:94 E