---
title: "Untitled"
output: html_document
---
Input the design matrix, \(\mathbf{X}\) from the following data in R
y | age |
---|---|
2 | “<20” |
3 | “20-50” |
5 | “>50” |
10 | “<20” |
1 | “20-50” |
3 | “>50” |
Estimate the \(\beta\) coefficients for predicting y from age.
We are interested in predicting a chicken’s weight based on their diet using the chickwts
dataset
Show that the variance of \(\mathbf{x}_0^T\hat\beta\) is
\[\textrm{var}(\mathbf{x}_0^T\hat\beta) = \mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0\sigma^2\]
\[(1 + \mathbf{x}_0^T(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{x}_0)\sigma^2\]