1) Plot colony size by soil porosity. What... The values on soil seems to be shooting out faster...

advertisement
1) Plot colony size by soil porosity. What are the indications that soil needs to be logged?
The values on soil seems to be shooting out faster than colony can keep up
2) Do the regression predicting colony size by the log of soil
a. Show the summary from the lm command
Call:
lm(formula = colony ~ log(soil))
Residuals:
Min
1Q
-1906.7 -710.0
Median
-93.3
3Q
502.5
Max
3748.8
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
7023.3
183.2
38.34 < 2e-16 ***
log(soil)
1272.9
122.9
10.36 8.34e-15 ***
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 979.7 on 58 degrees of freedom
Multiple R-squared: 0.649,
Adjusted R-squared: 0.643
F-statistic: 107.3 on 1 and 58 DF, p-value: 8.341e-15
b. Plot the original data with the logged curve
c. Explain the effect of soil porosity by starting a sentence with “As soil porosity increases
by 5%...”
As soil porosity increases by 5% the ant colony grows by 62.105
A study randomly selected 30 years to track the solar flares and the skin cancer rate. The goal is to
predict the cancer rate based on the solar flares. The data is shown below
1) Plot a graph of cancer rate predicted by solar flare. What tells you the cancer rate needs a log?
It is exploding on the cancer scale
2) Plot cancer rate by the log of solar flare. What tells you the solar flare also needs a log?
Still shows curvature as it expands in the x direction
3) Do the regression predicting colony size by the log of soil
a. Show the summary from the lm command
Call:
lm(formula = log(cancer) ~ log(solar))
Residuals:
Min
1Q
Median
-0.94372 -0.25474 -0.06251
3Q
0.38859
Max
0.70815
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
0.7575
0.0901
8.407 3.82e-09 ***
log(solar)
5.1466
0.1199 42.911 < 2e-16 ***
--Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4687 on 28 degrees of freedom
Multiple R-squared: 0.985,
Adjusted R-squared: 0.9845
F-statistic: 1841 on 1 and 28 DF, p-value: < 2.2e-16
b. Plot the original data with the logged curve
c. Explain the effect of solar flares by starting a sentence with “As solar flare activity
increases by 15%...”
As solar flare activity increases by 15%, the cancer rate increases by 105.3%, about doubling.
soil<-c(0.993,0.215, 0.699, 0.569, 0.083, 0.361, 0.479, 0.536, 0.920, 0.388, 0.273,
0.934, 0.233, 0.190, 0.646, 0.995, 0.211, 0.317, 0.517, 0.331, 0.177, 0.023, 0.447,
0.053, 0.413, 0.984, 0.235, 0.059, 0.197, 0.919, 0.018, 0.310, 0.918, 0.518, 0.473,
0.514, 0.576, 0.319, 0.250, 0.427, 0.492, 0.740, 0.761, 0.354, 0.482, 0.832, 0.305,
0.726, 0.953, 0.540, 0.456, 0.048, 0.601, 0.137, 0.668, 0.008, 0.130, 0.812, 0.904,
0.813)
colony<-c(7655,5317,6833,6452,4352,5201,6606,5652,7165,4850,5832,6617,
4491,5154,6165,5757,4326,5533,5904,4596,6267,2871,5878,4694,5190,6369,
6994,2746,5354,7045,3,4635,5535,5255,7427,6346,5964,5675,5983,9689,6999,
6367,6033,5141,6826,7939,4777,5587,5981,6665,4712,3092,5653,4669,7411,
752,3594,5822,8002,8662)
plot(colony~soil)
fit<-lm(colony~log(soil))
summary(fit)
x<-seq(min(soil),max(soil),length=1000)
y<-fit$coefficients[1]+fit$coefficients[2]*log(x)
lines(x,y)
solar<-c(0.8440,0.3141,1.4007,0.8575,1.9710,1.4977,0.8948,0.3073,1.0572,
1.2060,0.1841,1.6699,0.2697,1.7339,0.2203,0.3969,1.7697,0.6079,0.3685,
1.8188,0.7885,1.2875,1.2837,0.9347,0.7223,0.2570,1.6871,1.5962,0.9675,
0.4900)
cancer<-c(0.9188,0.0102,17.7782,1.7796,100.3534,24.7244,1.0302,0.0038,2.2203,6.0995,0.0003,
19.9289,0.0015,53.4887,0.0018,0.0294,62.7588,0.2159,0.0081,18.7266,0.5234,6.3256,11.4186,
0.5864,0.5315,0.0016,15.5781,39.4192,1.4909,0.0357)
plot(cancer~solar)
plot(log(cancer)~solar)
fit<-lm(log(cancer)~log(solar))
summary(fit)
plot(cancer~solar)
x<-seq(min(solar),max(solar),length=1000)
y<-exp(fit$coefficients[1]+fit$coefficients[2]*log(x))
lines(x,y)
Download