x = c(0.02, -0.48, -1.68, -1.12, 0.87, 0.86, -0.34, 0.19, 0.2,
-0.79, -0.78, -0.08, 0.07, -0.78, -1.45, 1.4, 1.34, 1.1, -0.27,
-0.16, 0.48, 0.03, -0.3, 1.81, -2.26, -0.18, 1.15, -0.56, 0.88,
-0.49)
y = c(0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
0, 1, 0, 1, 0, 0, 0, 0, 1, 0)
1. (5pts) Suppose we have data in pairs (Li, Yi) for i = 1, 2, ..., 30. Conditional on li, Y; is Bernoulli with success probability exp(Bo + B12) Pi = P(Y; = 12;) 1+exp(Bo + B12;) For this question, you'll be asked to compute the maximum likelihood estimate of B = (Bo, B1). Note that the log-likelihood is 30 1(B;x, y) = (yšlog(Pi) + (1 – yi) log(1 – P;)]. = i=1 The data are given below: x = c(0.02, -0.48, -1.68, -1.12, 0.87, 0.86, -0.34, 0.19, 0.2, -0.79, -0.78, -0.08, 0.07, -0.78, -1.45, 1.4, 1.34, 1.1, -0.27, -0.16, 0.48, 0.03, -0.3, 1.81, -2.26, -0.18, 1.15, -0.56, 0.88, -0.49) 2 y = c(0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0) (a) Use the function optim() to compute ß, using the initial value (0,0). Compare your result with the output from the R built-in logistic regression function (glm(..., family 'binomial')). =
1. (5pts) Suppose we have data in pairs (Li, Yi) for i = 1, 2, ..., 30. Conditional on li, Y; is Bernoulli with success
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1. (5pts) Suppose we have data in pairs (Li, Yi) for i = 1, 2, ..., 30. Conditional on li, Y; is Bernoulli with success
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!