Linear Statistical Models, Quiz 1
If and , then show that . Write all the steps clearly. [4 Marks]
Consider the following R code and answer the sub-questions based on the code.
N <- 1000x <- rpois(N, lambda = 2)summary(x)var(x)
## Output> summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.000 1.000 2.000 1.957 3.000 9.000> var(x)[1] 1.975126(i) What does the command x <- rpois(N, lambda = 2) do? Explain your answer. [2 Marks]
(ii) Interpret the output of the command summary(x). [2 Marks]
(iii) What are the values of the theoretical mean and the observed sample mean of the distribution ? [1 Mark]
(iv) Are the theoretical mean and variance close to the sample mean and sample variance? Why or why not? Justify your answer. [2 Marks]
| Diet A (Population 1) | Diet B (Population 2) |
|---|---|
| 5 | 8 |
| 7 | 4 |
| 8 | 12 |
| 8 | 8 |
Using a one way classification model, answer the given subquestions.
(i) Calculate . [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]
(i) Write the linear regression model for the given data and then find and . [2 Marks]
(ii) Find the least square estimate for . [5 Marks]
(iii) Write the fitted equation and estimate the value of when . [2 Marks]
1. If $X \sim \text{Normal}(0, 1)$ and $Y = X^2$, then show that $Y \sim \chi^2_1$. Write all the steps clearly. [4 Marks] 2. Consider the following R code and answer the sub-questions based on the code. N <- 1000 x <- rpois(N, lambda = 2) summary(x) var(x) ## Output > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.000 1.000 2.000 1.957 3.000 9.000 > var(x) [1] 1.975126 (i) What does the command `x <- rpois(N, lambda = 2)` do? Explain your answer. [2 Marks] (ii) Interpret the output of the command `summary(x)`. [2 Marks] (iii) What are the values of the theoretical mean and the observed sample mean of the distribution $X$? [1 Mark] (iv) Are the theoretical mean and variance close to the sample mean and sample variance? Why or why not? Justify your answer. [2 Marks] 3. A nutrition researcher is investigating whether two different diets (Diet A and Diet B) affect people's daily protein intake differently. She records the protein intake (in grams) of individuals on the two diets, and the observations $y_{ij}$ is shown in the following table: | Diet A (Population 1) | Diet B (Population 2) | |---|---| | 5 | 8 | | 7 | 4 | | 8 | 12 | | 8 | 8 | Using a one way classification model, answer the **given** subquestions. (i) Calculate $\overline{Y}_{1o}, \overline{Y}_{2o}, \overline{Y}_{oo}$. [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] 4. Suppose we have data $D = \{(x, y) : (0, 3), (1, 4), (2, 7)\}$ and assume the linear model $(\vec{y}, X\vec{\beta}, I_{3\times3})$ for the data. (i) Write the linear regression model for the given data and then find $\vec{Y}, X, \vec{\beta}$ and $\vec{\epsilon}$. [2 Marks] (ii) Find the least square estimate for $\vec{\beta}$. [5 Marks] (iii) Write the fitted equation and estimate the value of $y$ when $x = 3$. [2 Marks]