Question 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]
- 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 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 . [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]
- Suppose we have data and assume the linear model for the data.
(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]
I have written answers on the answer sheets
Not applicable