留学生作业代写do not hesitate to contact me!
WeChat:lovexc60
Question 1. Simple Linear Regression
(a) Consider a data set consisting ofX values (features)X1; : : : ;Xn and Y values (responses) Y1; : : : ; Yn.
Let ^ 0; ^ 1; ^ be the output of running ordinary least squares (OLS) regression on the data. Now
define the transformation:
e Xi = c(Xi + d);
for each i = 1; : : : ; n, where c = 0 and d are arbitrary real constants. Let e 0; e 1; e be the output of
OLS on the data e X1; : : : ; e Xn and Y1; : : : ; Yn. Write equations for e 0; e 1; e in terms of ^ 0; ^ 1; ^ (and
in terms of c; d), and be sure to justify your answers. Note that the estimate of error in OLS is taken
to be:
where ^ e is the vector of residuals, i.e. with i-the element ^ ei = Yi ^ Yi, where ^ Yi is the i-th prediction
made by the model, and p is the number of features (so in this case p = 2).
(b) Suppose you have a dataset where X takes only two values while Y can take arbitrary real values.
To consider a concrete example, consider a clinical trial where Xi = 1 indicates that the i-th patient
receives a dose of a particular drug (the treatment), and Xi = 0 indicates that they did not, and
Yi is the real-valued outcome for the i-th patient, e.g. blood pressure. Let Y T and Y P indicate the
sample mean outcomes for the treatment group and non-treatment (placebo) group, respectively.
What will be the value of the OLS coefficients ^ 0; ^ 1 in terms of the group means?
What to submit: For both parts of the question, present your solution neatly – photos of handwritten work or