Stat 431 ASSIGNMENT 3 SOLUTIONS
1. (a) Given the tolerance distribution, the probability of response the dose x is
π(x) = Zx
−∞
exp((u − µ)/δ)
δ(1 + exp((u − µ)/δ)
2
du
=
exp((x − µ)/δ)
1 + exp((x − µ)/δ)
⇒ log π(x)
1 − π(x)
= −
µ
δ
+
1
δ
x
This ...
1. (a) Given the tolerance distribution, the probability of response the dose x is
Zx
exp((u − µ)/δ)
π(x) = du
δ(1 + exp((u − µ)/δ)2
−∞
exp((x − µ)/δ)
=
1 + exp((x − µ)/δ)
π(x) µ 1
⇒ log = − + x
1 − π(x) δ δ
This implies that it is most appropriate to choose a logistic link function.
(b) The binary logistic regression model is
π(x)
log = β0 + β1 x
1 − π(x)
where β0 = − µδ and β1 = 1δ .
(c) The R code and output for fitting the logistic regression model are given below:
# Input the data
ammonia.dat<-read.table("ammonia.dat",header=T)
# Construct the response variable for logistic regression
ammonia.dat$resp<-cbind(ammonia.dat$y,ammonia.dat$m-ammonia.dat$y)
# Fit a dose response model using the logit model.
model.1<-glm(resp~z,family=binomial(link=logit),data=ammonia.dat)
summary(model.1)
Coefficients:
Value Std. Error t value
(Intercept) -16.49433 1.458861 -11.30631
z 18.51255 1.599858 11.57137
(Dispersion Parameter for Binomial family taken to be 1 )
Null Deviance: 286.8762 on 7 degrees of freedom
Residual Deviance: 3.181074 on 6 degrees of freedom
# Determine p-value of residual deviance
1-pchisq(3.181074, 6)
[1] 0.7858011
From the above output, we see the residual deviance given by D = 3.181074 with 6 d.f.,
and p-value= D(χ2(6) > 3.181074) = 0.7858011, this indicates that the logistic model
does provide a good fit to the observed data.
The R code for producing the dose-response curve are given below:
beta<-model.1$coefficients
dose<-seq(0.7, 1.15, by=0.0001)
x<-cbind(rep(1, length(dose)), dose)
prob<-exp(x%*%beta)/(1+exp(x%*%beta))
From the plot, we see the observed probabilities of response (the dots) and the estimated
probabilities of response (the curve) from the fitted logistic regression model agree quite
well, which also implies that the model fits the data well.
(d) Realize that the tolerance distribution is actually logistic distribution. You can just
recognize this and use the result that the variance of the logistic distribution is
π2δ2
σ2 = .
3
Alternatively, you can try to derive the variance by first finding the MGF of this distribu-
tion function: M (t) = eµt Γ(1+δt)Γ(1−δt) and then the variance is just M 00 (0)−(M 0 (0))2 .
The CI for β1 is (15.37683, 21.64827)), so the CI for the variance of u is
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Abbyy01. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $6.49. You're not tied to anything after your purchase.