Description
3 questions(Do it by hand… you may use R for double-checking, if you want)
A sample of size n = 6 contains two independent variables X1, X2 and one categorical
response variable Y . However, response for the 3rd sampling unit is missing.
X1 -2 -1 0 1 2 3
X2 2 -2 0 0 3 2
Y B B ??? A A B
Your task is to reconstruct the missing Y3 by different classification methods.
(a) Predict Y3 by KNN method with k = 1.
(b) Predict Y3 by KNN method with k = 3.
(c) Logistic regression, without the 3rd sampling unit, produced the following results.
> z = 1*(y==“B”)
> lreg = glm( z ∼ x1 + x2, family=binomial)
> summary(lreg)
Coefficients:
(Intercept)
x1
x2
Estimate the probability that Y3 = “B”.
Estimate
0.8373
-0.4494
-0.0778
(d) Suppose that X1 and X2 are independent Normal random variables with the same
variance σ2 = 1. Assuming equal prior probabilities P(A) = P(B) = 0.5, predict Y3 by
the linear discriminant analysis.
1 attachmentsSlide 1 of 1attachment_1attachment_1
Unformatted Attachment Preview
Purchase answer to see full
attachment
Tags:
logistic regression
independent variables
categorical response
classification methods
independent normal
User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.
Reviews, comments, and love from our customers and community: