Question
Execution of the following 3 R commands will give us the data {(x(i), y(i), z(i), i = 1, 2, ...,100}. x
Execution of the following 3 R commands will give us the data {(x(i), y(i), z(i), i = 1, 2, ...,100}.
x<-rpois(100, 50)
y<-rpois(100, 100)
z<-rpois(100, 150)
Using this data:
a. Fit the linear regression model of the form z = a +b.x + c.y using,
(i) R
(ii) By obtaining the three normal equations in a, b, and c. Solve these equations
using R and compare the model thus obtained with the model obtained in (i). The
compactness of R commands will be important for this part of the problem. For
example, a single line R command resulting into the formation and solution of the
3 equations shall attract the maximum marks.
Support your solution with appropriate tables involving the data, R commands, and
results obtained from R commands.
b. Fit the 3 models of the form y = a + b.x, y = a + b.x + c.x2
, and y = a.bx
to this data using,
(i) R
(ii) By obtaining two normal equations in a and b (or three normal equations in a, b,
and c). Solve these equations using R and compare the models thus obtained with
the models obtained in (i). The compactness of R commands will again be
important for this part of the problem. For example, a single line R command
resulting into the formation and solution of the 2 equations shall attract the
maximum marks.
(iii) Also, find the coefficient of determination, with the help of formula, for the three
models and decide for the best model.
Again, support your solution with appropriate tables involving the data, R commands,
and results obtained from R commands.
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