Quiz Space

Linear Statistical Models · Quiz 1 · 23 Feb 2025 · January 2025 term

Question 1: (a) Find the best fit line \hat{y}. [2 Marks] (b) Find th…

Question 1

+30 marksOne correct option
  1. A linear regression model y^=a0+a1x\hat{y} = a_0 + a_1 x is fit for the cars dataset. The dataset has 50 observations with 2 variables dist and speed. Study the code and answer the following subquestions:
r
data(cars)
y <- cars$dist
x <- cars$speed
car_mod <- lm(y ~ x, data = cars)
coef(car_mod)
## Output
> coef(car_mod)
(Intercept) x
-17.579095 3.932409

(a) Find the best fit line y^\hat{y}. [2 Marks]

(b) Find the residual corresponding to the data point (x,y)=(4,2)(x, y) = (4, 2). [3 Marks]

  1. Let X1,X2,…,XnX_1, X_2, \ldots, X_n be i.i.d. samples from a normal distribution with mean μ\mu and variance σ2\sigma^2. Consider the sample mean and sample variance as

X‾=1n∑i=1nXi,S2=1(n−1)∑i=1n(Xi−X‾)2,\overline{X} = \frac{1}{n}\sum_{i=1}^{n} X_i, \qquad\qquad S^2 = \frac{1}{(n-1)}\sum_{i=1}^{n}(X_i - \overline{X})^2,

then which of the following are true? Select all that apply [3 Marks]

(a) X‾∼Normal(μ,σ2/n)\overline{X} \sim \text{Normal}(\mu, \sigma^2/n)

(b) X‾∼Normal(μ,nσ2)\overline{X} \sim \text{Normal}(\mu, n\sigma^2)

(c) (n−1)S2σ2∼χn2\dfrac{(n-1)S^2}{\sigma^2} \sim \chi^2_n

(d) n(X‾−μ)S∼tn\dfrac{\sqrt{n}(\overline{X} - \mu)}{S} \sim t_n

(e) n(X‾−μ)S∼t(n−1)\dfrac{\sqrt{n}(\overline{X} - \mu)}{S} \sim t_{(n-1)}

  1. Consider the first 10 rows of the iris dataset as below:
r
head(iris, 10)
## output
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 1.0 1.0 1.0 1.0 <NA>
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 2.0 2.0 2.0 2.0 <NA>
8 5.0 3.4 1.5 0.2 setosa
9 3.0 3.0 3.0 3.0 <NA>
10 4.9 3.1 1.5 0.1 setosa

(a) What will be the output of iris[7, 5]? [1 Mark]

(b) What will be the output of the following code snippet? [2 Marks]

r
iris$Sepal.Length[c(1, 4, 7)] = c(5, 5, 5)
iris[c(1, 4, 5), ]

(c) The iris dataset contains a total of 150 observations. Consider the following output:

r
var(iris$Sepal.Length)
[1] 0.8636282

Then, find the population variance of the variable Sepal.Length. [2 Marks]

  1. Consider the linear model :

yij=α+βxij+γi+ϵij;1≤j≤ni , 1≤i≤3,y_{ij} = \alpha + \beta x_{ij} + \gamma_i + \epsilon_{ij} \quad ; \quad 1 \leq j \leq n_i \, , \, 1 \leq i \leq 3,

where :

  • γi∼N(0,σγ2)\gamma_i \sim N(0, \sigma^2_\gamma) is a random effect for group ii, independent of ϵij\epsilon_{ij}.
  • ϵij∼N(0,σϵ2)\epsilon_{ij} \sim N(0, \sigma^2_\epsilon) are independent errors.
  • xijx_{ij} is a known covariate.

Find the distribution of yijy_{ij}. [2 Marks]

  1. Suppose you fit a linear regression model to the following data:
x⃗\vec{x}y⃗\vec{y}
12
24
35
44
55

and the estimated regression equation is : y⃗^=2.2+0.6x\hat{\vec{y}} = 2.2 + 0.6x. If the prediction errors be defined by e⃗i=y⃗i−y⃗^i\vec{e}_i = \vec{y}_i - \hat{\vec{y}}_i, then calculate the value of ∑i=1n(e⃗i)2\sum_{i=1}^{n}(\vec{e}_i)^2. [4 Marks]

  1. Let (Y⃗,Xβ⃗,σ2In)(\vec{Y}, X\vec{\beta}, \sigma^2 I_n) be a linear model and p∈Rmp \in \mathbb{R}^m. Prove that pTβ⃗p^T\vec{\beta} is estimable ⇔p∈C(XT)\Leftrightarrow p \in C(X^T). [4 Marks]

  2. Consider a model:

y1=2β1+2β2+2β3+2β4+ϵ1 ;y2=2β1+2β3−2β2−2β4+ϵ2 ;y3=2β1+2β2−2β3−2β4+ϵ3 ;y4=2β1+2β4−2β2−2β3+ϵ4 ,\begin{aligned} y_1 &= 2\beta_1 + 2\beta_2 + 2\beta_3 + 2\beta_4 + \epsilon_1 \,; \\ y_2 &= 2\beta_1 + 2\beta_3 - 2\beta_2 - 2\beta_4 + \epsilon_2 \,; \\ y_3 &= 2\beta_1 + 2\beta_2 - 2\beta_3 - 2\beta_4 + \epsilon_3 \,; \\ y_4 &= 2\beta_1 + 2\beta_4 - 2\beta_2 - 2\beta_3 + \epsilon_4 \,, \end{aligned}

where βi∈R\beta_i \in R and ϵi\epsilon_i's are uncorrelated random variables with variance σ2\sigma^2; i=1,2,3,4i = 1, 2, 3, 4.

(a) If we want to rewrite the model as (Y⃗,Xβ⃗,I4×4)(\vec{Y}, X\vec{\beta}, I_{4\times4}), then find Y⃗,X,β⃗\vec{Y}, X, \vec{\beta} and ϵ⃗\vec{\epsilon}. [2Marks]

(b) Define Normal equations and using normal equations find the least square estimates of β1,β2,β3\beta_1, \beta_2, \beta_3 and β4\beta_4. [5 Marks]

  1. A

    I have written answers on the answer sheets

  2. B

    Not applicable

Show answer

Correct answer

  • A

    I have written answers on the answer sheets

Question 1 of 1 in the IIT Madras BS Linear Statistical Models (Linear Statistical Models) Quiz 1 paper sat on 23 Feb 2025, in the January 2025 term (IIT M IMPROVEMENT AN EXAM QIM2 23 Feb 2025). It carries 30 marks.

More questions from this paper