Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use R code to solve it. Write your own function my.ls() which performs the least square estimation for a con tinuous response variable y

image text in transcribed

please use R code to solve it.

image text in transcribedimage text in transcribed
Write your own function my.ls() which performs the least square estimation for a con tinuous response variable y regressed on two predictors 321 which is a numeric predictor and 332 which is a categorical predictor. You may assume that your model contains an intercept. Test your function on the ChickWeight dataset in R, where y is weight, x1 is Time (assumed to be continuous) and x2 is Diet, i.e., check if your function can reproduce the estimated beta coefficients from data (ChickWeight) fit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Physics For Scientists And Engineers With Modern Physics

Authors: Raymond A Serway, John W Jewett

10th Edition

133767172X, 9781337671729

More Books

Students also viewed these Mathematics questions

Question

8. What are the costs of collecting the information?

Answered: 1 week ago