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 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
Get step-by-step solutions from verified subject matter experts
