Linear Statistical Models, Quiz 1
> Math_marks = c(70, 85, 92, 60, 55, 60)> Stats_marks = c(80, 70, 80, 90, 75, 65)> Marks = data.frame(Math_marks, Stats_marks)> Marks Math_marks Stats_marks1 70 802 85 703 92 804 60 905 55 756 60 65Based on the given information, answer the following questions.
(i) What will be the output of the command head(Marks, 2)? [2 Marks]
(ii) What will be the output of the command Marks[2,3]? [2 Marks]
(iii) Write an R code that can be used to extract the marks of fourth student in Stats and Maths. [2 Marks]
(a)
(b)
(c)
(d)
1. Consider the following R code which contains the information of marks of six students in Statistics and Mathematics subjects. > Math_marks = c(70, 85, 92, 60, 55, 60) > Stats_marks = c(80, 70, 80, 90, 75, 65) > Marks = data.frame(Math_marks, Stats_marks) > Marks Math_marks Stats_marks 1 70 80 2 85 70 3 92 80 4 60 90 5 55 75 6 60 65 Based on the given information, answer the following questions. (i) What will be the output of the command `head(Marks, 2)`? [2 Marks] (ii) What will be the output of the command `Marks[2,3]`? [2 Marks] (iii) Write an R code that can be used to extract the marks of fourth student in Stats and Maths. [2 Marks] 2. Let $X_1, X_2, X_3 \sim$ iid $N(0, 1)$ and $Y \sim \chi^2_n$. If each $X_i$ $(i = 1, 2, 3)$ is independent of $Y$, then which of the following options is(are) true? [2 Marks] (a) $X_1^2 + X_2^2 + X_3^2 \sim t_3$ (b) $X_1^2 + X_2^2 + X_3^2 \sim \chi^2_3$ (c) $\dfrac{X_1}{\sqrt{\dfrac{Y}{n}}} \sim t_n$ (d) $\dfrac{X_2}{\sqrt{\dfrac{Y}{n}}} \sim t_{n-1}$ Scatter plot of Calories Burned vs Time Exercised (hours), with questions on it and on one way classification statements 5. Consider a one way classification model and following table contains the observations, $y_{ij}$, of a data which has been divided into two populations (classes). | Population 1 | Population 2 | |---|---| | 4 | 5 | | 5 | 5 | | 4 | 4 | | 7 | 6 | Based on the given information, answer the following questions. (i). Calculate $\overline{Y}_{1o}, \overline{Y}_{2o}, \overline{Y}_{oo}$ and interpret your results. [4 Marks] (ii). Find the value of sum of squares within group (SSW). [4 Marks] (iii). Find the value of sum of squares between group (SSB). [2 Marks] (iv). Calculate the value of total sum of squares (TSS). [4 Marks] (v). Verify that TSS $=$ SSB $+$ SSW. [1 Mark] 6. Write the definition of “Least square estimation” and define all the notations properly. [3 Marks] 7. Consider a model: $$\begin{aligned} y_1 &= 5\beta_1 + 2\beta_2 + \epsilon_1 \;\; ; \\ y_2 &= 3\beta_1 - 2\beta_2 + \epsilon_2. \end{aligned}$$ where, $\epsilon_i$'s $(i = 1, 2)$ are uncorrelated random variables with variance 1. (i) Find the mathematical expression for $\|\vec{Y} - X\vec{\beta}\|_2$. [3 Marks] **Hint:** If $z \in \mathbb{R}^n$, then $\|z\|_2 = \sqrt{z^T z} = \sqrt{\sum_{i=1}^{n} z_i^2}$. (ii) Let $\vec{Y} = \begin{pmatrix} 10 \\ 6 \end{pmatrix}$, then which value of vector $\vec{\beta}$ among the following will minimize the expression $\|\vec{Y} - X\vec{\beta}\|_2$ ? [4 Marks] (a) $\vec{\beta} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$ (b) $\vec{\beta} = \begin{pmatrix} -1 \\ -1 \end{pmatrix}$ (c) $\vec{\beta} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$ (d) Cannot determine.