Application Exercise
- Open Rstudio Server Pro
- Create a new project
- Click File > New File > R Markdown
- Delete everything except for
---
title: "Untitled"
output: html_document
---
- Give your work a sensible title
- When you’ve finished, upload the .html file to Canvas
Input the design matrix, X from the following data in R
2 |
“<20” |
3 |
“20-50” |
5 |
“>50” |
10 |
“<20” |
1 |
“20-50” |
3 |
“>50” |
Estimate the β coefficients for predicting y from age.
We are interested in predicting a chicken’s weight based on their diet using the chickwts
dataset
- Fit the model of interest and extract the estimated β coefficients
- Construct x0 for a chicken that is eating “sunflower”.
- Find the predicted weight for a chicken eating sunflowers.
Show that the variance of xT0ˆβ is
var(xT0ˆβ)=xT0(XTX)−1x0σ2
- What is the expected value of xT0β+ϵ?
- Show that the variance is
(1+xT0(XTX)−1x0)σ2