Question: 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

 please use R code to solve it. Write your own function

please use R code to solve it.

my.ls() which performs the least square estimation for a con tinuous responsevariable y regressed on two predictors 321 which is a numeric predictor

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!