Answered step by step
Verified Expert Solution
Question
1 Approved Answer
set.seed(1) (a) Using the rnorm() function, create a vector, x, containing 100 observations drawn from a N(0,1) distribution. This represents a feature, X (b)Using the
set.seed(1)
(a) Using the rnorm() function, create a vector, x, containing 100 observations drawn from a N(0,1) distribution. This represents a feature, X
(b)Using the rnorm() function, create a vector, eps, containing 100 observations drawn from a N(0,0.25) distributiona normal distribution with mean zero and variance 0.25.
(c)Using x and eps, generate a vector y according to the model
Y =1+0.5X+.
(d) Fit a least squares linear model to predict y using x
(e) Now fit a polynomial regression model that predicts y using x and x2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started