UCLA Coefficients Independent Variables and Classification Methods Worksheet
Question 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 categoricalresponse variable Y . However, response for the 3rd sampling unit is missing.
X1 -2 -1 0 1 2 3X2 2 -2 0 0 3 2Y 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.
Estimate0.8373-0.4494-0.0778
(d) Suppose that X1 and X2 are independent Normal random variables with the samevariance ?2 = 1. Assuming equal prior probabilities P(A) = P(B) = 0.5, predict Y3 bythe linear discriminant analysis.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."