Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Analysis in R
As part of your narrative to each answer, please be sure to copy all
supporting graphs, statistics, and R code into this document.
Question 1: Linear regression analysis without data transformation
Load data
y=c(5.39,5.73,6.18,6.42,6.77,7.11,7.46,7.7
1,8.15,8.5);
x=c(4,5,6,7,8,9,10,11,12,13);
dat=cbind(x,y);
dat=as.data.frame(dat);
o
o
- Yes the points line up on the 45-degree line. Our data are
normally distributed, thus normal distribution from the
residuals.
o Constant variance: Scale-Location
Is the spread of the points the same?
- Since the spread of the points are the same there is
constant variance.
o Provide 1 statistic and 1 chart that show that transforming
data can not improve regression performance.
1. We still reject the null hypothesis and have not improved our
regression performance from (r2 = 0.9886, p = 2.067e-12) to (r2 =
0.9882, p = 3.347e-09).
2. The linear regression line still fits the data well and has not
improved significantly.
Load data
Number=c(8398,239,728,758,1453,75,27,915,67,4,28,1,168
,7,16,7,3);
Distance=c(364,357,343,251,216,133,115,90,88,58,54,54,5
3,47,25,16,8);
dat=cbind(Number,Distance);
dat=as.data.frame(dat);
Could you improve the model fit by transforming the data? (Hint:
Yes, you can). If so, answer the following questions based on logtransformed data:
o
o
o
o