Tame some time to review the following data set. a) Conduct work with R to const
ID: 3240018 • Letter: T
Question
Tame some time to review the following data set. a) Conduct work with R to construct a multivariate linear regression model that defines Y as a function of X1 and X2. If you need to make any data transformations you are free to do so. b) Use this regression to estimate Y at points (X1,X2) at (0,0), (0,5), (5, 0) and (5,5). Attach your R code and in comments do explain any transformations you make to work with the data set. Do these transformations necessarily make your model or your results non-linear?Explanation / Answer
> mydata<-read.csv("C:\Users\GAnguLY\Desktop\chegg.csv")
> mydata
X1 X2 Y
1 5 1 15,162
2 5,1 2 17,544
3 5,2 3 27,895
4 5,3 4 28,368
5 5,4 5 31,531
6 5,5 6 38,403
7 5,6 7 38,726
8 5,7 8 42,189
9 5,8 9 38,752
10 5,9 10 42,426
11 6 11 48,149
12 6,1 12 54,023
13 6,2 13 55,278
14 6,3 14 56,322
15 6,4 15 68,577
16 6,5 16 69,301
17 6,6 17 65,706
18 6,7 18 70,681
19 6,8 19 78,447
20 6,9 20 84,113
> fit<-lm(Y ~ X1 + X2, data = mydata)
Warning messages:
1: In model.response(mf, "numeric") :
using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
> summary(fit)
Call:
lm(formula = Y ~ X1 + X2, data = mydata)
Residuals:
ALL 20 residuals are 0: no residual degrees of freedom!
Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1 NA NA NA
X15,1 1 NA NA NA
X15,2 2 NA NA NA
X15,3 3 NA NA NA
X15,4 4 NA NA NA
X15,5 5 NA NA NA
X15,6 6 NA NA NA
X15,7 8 NA NA NA
X15,8 7 NA NA NA
X15,9 9 NA NA NA
X16 10 NA NA NA
X16,1 11 NA NA NA
X16,2 12 NA NA NA
X16,3 13 NA NA NA
X16,4 15 NA NA NA
X16,5 16 NA NA NA
X16,6 14 NA NA NA
X16,7 17 NA NA NA
X16,8 18 NA NA NA
X16,9 19 NA NA NA
X2 NA NA NA NA
Residual standard error: NA on 0 degrees of freedom
Multiple R-squared: NA, Adjusted R-squared: NA
F-statistic: NA on 19 and 0 DF, p-value: NA
Warning message:
In Ops.factor(r, 2) : ‘^’ not meaningful for factors
The data is erroneous.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.