STAT 431/831
ASSIGNMENT 1
DUE: OCTOBER 2, 2008
1. [9 points]
For an individual i, i = 1, 2, . . . , n, denote
t
i = I (Ti Ci )
Ti = remission time
S (t) = P (T > t) = 1
f (s; )ds
0
t
Ci = censoring time
exp(s)ds = exp(t)
=1
ti = min(Ti , Ci )
0
From the
STAT 431
ASSIGNMENT 1
DUE: Wed, January 25, 2012, AT 10:30 AM
1. (a) The likelihood is
n
n
L() = (2 2 ) 2 exp
(yi )2 /2 2 .
i=1
The log likelihood is
n
n
() = log (2 2 ) (yi )2 /2 2 .
2
i=1
(b) The score function is
n
(yi )/ 2 = n( )/ 2 .
y
S () =
i=1
Th
1
STAT 431
ASSIGNMENT 2
DUE: Monday, February 13, 2012, AT 10:30 AM
QUESTION 1
(a) We start our investigation by tting the main eects model, that is, the model with only TNF
(denoted by x1 ) and IFN (denoted by x2 ) doses included, and the model that incl
STAT 431
ASSIGNMENT 2
DUE: Monday, February 13, 2012, AT 10:30 AM
1. In a biomedical study of an immunoactivating ability of two agents TNF (tumor necrosis
factor) and IFN (interferon), to induce cell dierentiation, the number of cells that exhibit
marke
Stat 431
Winter 2011
Assignment 2
Assignment due at 10:30 a.m., Friday February 4.
1. The following data are from a study of the eects of viruses on chicken eggs. Eggs were
injected with various dilutions of a virus and were monitored daily up to day 18 a
Please do not post online
Matthias Schonlau , Stat 431, Solution
Question 1 . Inverse Gaussian
a) [4 marks ] For an observation Y from the inverse Gaussian distribution we have:
( y )2
f ( y; , ) =
exp
, , y > 0
2
2 y3
2 y
y 2 2 y 2 1
= exp
log
Stat 431, Winter 2015  Assignment 4
Instructor Dr. Schonlau, due on Friday April 3, 2015 at noon. Either submit a softcopy online into LEARN
or as a hardcopy (Box 15 located on the 4th floor of MC). Someone will collect the assignments at that
time or af
Stat 431
Winter 2011
Assignment 1
Assignment due at 10:30 a.m., Friday January 21.
1. Consider a 2 2 contingency table from a prospective study in which people who
were or were not exposed to some pollutant are followedup and, after several years,
catego
STAT 431/831
ASSIGNMENT 2
DUE: OCTOBER 21, 2008
1. [9 points] A sample of 146 veyearold children had their teeth examined and those with decayed,
missing, or lled teeth (dmft) were noted. From their address it was also determined whether their
drinking
Stat 431/831
Assignment 3
Due: 12pm November 1st, 2013
Note: Use cover page. Include all R code and relevant output. At the same time, you should
properly organize/summarize your results; we are not supposed to search for your results in R
output.
1. In a
Stat 431
ASSIGNMENT 4
Due: July 25th, 2013
Reminder:
Your assignment must be handed in by 11:30 on the due date in DWE 3522.
Be sure to include all R code and relevant output for all questions of this assignment.
1. Ashford and Sowden (1970) conducted a
STAT 431
ASSIGNMENT 1
DUE: Wednesday, January 25, 2012, AT 10:30 AM
1. Suppose that Yi , i = 1, . . . , n, are independent and identically distributed normal random
variables with unknown mean and known variance 2 . The probability density function of
eac
1
A Brief Review of Likelihood Methods
Problem 1.1.
Suppose that Yi , i = 1, . . . , n, are independent and identically distributed
normal random variables with unknown mean and known variance 2 . The
probability density function of each Y is then given b
(Please do not post online)
Matthias Schonlau Solution Stat 431 Winter 2015, A2
Q1 Surgical Risk Solution
(a)
i. H 1 : There is no association between treatment and outcome in any category of risk.
log i = o 2 x2 3 x3
1
i
with degrees of freedom 6 3
Stat 431, Winter 2015  Assignment 2
Instructor Dr. Schonlau, due on Wednesday Feb 4, 2015 at noon. Either submit a softcopy online into
LEARN or as a hardcopy (Box 15 located on the 4th floor of MC). Someone will collect the assignments
at that time or a
Please do not post on the web.
Stat 431, Winter 2015, A3 , solutions.
Question Fabric solution
(a) Under a time homogenous Poisson model we would have Yi Poisson(ti ) , i = 1, ,32 , and we
can find the loglikelihood through:
n
L( ) =
i =1
(ti ) i e
yi !
Stat 431, Winter 2015  Assignment 4
Instructor Dr. Schonlau, due on Friday April 3, 2015 at noon. Either submit a softcopy online into LEARN
or as a hardcopy (Box 15 located on the 4th floor of MC). Someone will collect the assignments at that
time or af
STAT 431/831
ASSIGNMENT 2
DUE: OCTOBER 16, 2008
1. A sample of 146 veyearold children had their teeth examined and those with
decayed, missing, or lled teeth (dmft) were noted. From their address it was
also determined whether their drinking water was u
STAT 431
SKETCH SOLUTIONS OF TERM EXAM 1
FEBRUARY 1, 2012
1. (a) Recall that in the case of a continuous random variable y :
f (y ; , )dy = 1
f (y ; , )dy =
1
f (y ; )dy = 0
assuming we can bring the dierential operator inside the integral. Since
1
log f
Contingency Tables
Matthias Schonlau, Ph.D.
Overview
Twoway tables
Multinomial
Product Multinomial
Poisson
2way Tables
.
2way Tables  Multinomial
Assume cell frequencies have independent
Poisson distribution.
By conditioning on the grand total w
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
Twoway contingency tables
Equivalence of approaches
2way Contingency Tables
A 2way contingency table shows crossclassified data on 2 categorical variables
Outside of academia this is usually refe
Contingency Tables
Matthias Schonlau, Ph.D.
Overview
Poisson regression /Loglinear models in the
suicide example
Model selection
Interpretation
Visualization (Mosaic plots)
Contrasts
Suicide
Data of people who
have committed
suicide.
input sex age m
Contingency Tables
Matthias Schonlau, Ph.D.
Overview
Example 2way contingency table: Malanoma
Mosaic plots to detect interactions
Omitting different categories
Example: Calculating Deviance residuals
Melanoma Study
Cross section study with a fixed numbe
3way contingency tables
Matthias Schonlau, Ph.D.
Overview
Mutual / Conditional / Joint independence
Goodness of fit
Example : Seatbelts
3way tables
In a two way table we had two categorical
variables
one twoway interaction
In a 3way table we hav
Negative Binomial Regression
Matthias Schonlau, Ph.D.
Negative Binomial
Instead of an adhoc solution, we now
consider a parametric model that addresses
overdispersion for Poisson regression.
Negative Binomial
Solution to overdispersion: add a parameter
Quasi Likelihood
Matthias Schonlau, Ph.D.
Quasi Likelihood
GLMs require specification of three
components:
random component (distribution)
systematic component (linear function)
link function
Estimate beta via maximum likelihood
Set the first deriva
Stat 431  ASSIGNMENT 4 SOLUTION
Spring 2017
1. [16 marks]
(a) [4 marks]
The best fitted mode is
st
!
DP
GP
P
D
log ijk = u + uG
i + uj + uk + uik + ujk

D
o
d.f.
pvalue
0
NA
24 0.228 (vs 1)
48 0.000 (vs 2)
30 0.001 (vs 2)
28 0.973 (vs 2)
34 0.000 (vs 5)
Stat 431  ASSIGNMENT 1 SOLUTION
Spring 2017
1. (a) [2 points]
The likelihood function is
n
n
Y
Y
Pn
L(p) =
P (Y = yi ; p) =
p(1 p)yi = pn (1 p) i=1 yi
i=1
i=1
The loglikelihood function is
l(p) = log L(p) = n log p +
n
X
yi log(1 p)
i=1
(b) [4 points]
T
Logistic Regression Analysis of Prenatal Care Data
What follows is the data file prenatal.dat.
The first line contains the variable labels and the remaining four lines the
data.
We are using indicator variables for the explanatory variables.
The binomial
Stat 431  ASSIGNMENT 2 SOLUTION
Spring 2017
1. (a) The 2 2 contingency table is as follows.
Pain Relief (N)
Treatment
3 (y1 )
Placebo
7 (y2 )
Pain(Y)
7 (m1 y1 )
1 (m2 y2 )
The estimate of the OR of pain relief for a patient with treatment versus placebo