In: Statistics and Probability
species | massx | deesY |
Northern pygmy-owl | 0٫07 | 3٫95 |
Saw-whet owl | 0٫08 | 4٫08 |
American kestrel | 0٫12 | 2٫75 |
Merlin | 0٫19 | 3٫03 |
Short-eared owl | 0٫35 | 2٫27 |
Coopers hawk | 0٫45 | 3٫16 |
Prairie falcon | 0٫72 | 2٫19 |
Peregrine falcon | 0٫72 | 2٫8 |
Great horned owl | 1٫4 | 2٫45 |
Rough-legged hawk | 0٫99 | 1٫33 |
Gyrfalcon | 1٫4 | 2٫24 |
Red-tailed hawk | 1٫08 | 2٫56 |
Great gray owl | 1٫08 | 2٫06 |
You will be testing a hypothesis for each dataset, and that test can be run using SPSS, JMP, or R. It is up to you to figure out how to test each hypothesis in whichever program you are using.
a) Using the Chickadee data, test the hypothesis that predator mass influences the number of ‘dees’ produced by Chickadees. Copy and paste the resulting statistical test below.
b) Create a figure showing the relationship between the number of dees and predator mass. Include the data points, the regression line, and a 95% confidence interval of the slope.
c) What do you conclude? Be sure to include the statistical test and the r2 value in your conclusion and interpretation of the results.
# R-code
x<-c(0.07,0.08,0.12,0.19,0.35,0.45,0.72,0.72,1.4,0.99,1.4,1.08,1.08)
y<-c(3.95,4.08,2.75,3.03,2.27,3.26,2.19,2.8,2.45,1.33,2.24,2.56,2.06)
cor.test(x,y)
model<-lm(y~x)
summary(model)
##### Output ########
### Correlation coefficient
Pearson's product-moment correlation
data: x and y
t = -3.0485, df = 11, p-value = 0.01108
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.8942685 -0.2004990
sample estimates:
cor
-0.6767251
The correlation is significant, implying that the predator mass
significantly
influence the number of dees and the correlation is negative means
the impact
is inverse between the two.
### Regression of y on x
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-1.0206 -0.4429 0.1671 0.3448 0.7779
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.3857 0.2799 12.097 1.07e-07 ***
x -1.0456 0.3430 -3.049 0.0111 *
The regression parameter is significant as described above for
the correlation
coefficient.
#############
### R-code for part (b)
model$coef
##> model$coef
##(Intercept) x
## 3.385748 -1.045633
A= 3.385748
B= -1.045633
confint(model)[2,]
##> confint(model)[2,]
## 2.5 % 97.5 %
##-1.8005590 -0.2907064
B_L= -1.8005590
B_U= -0.2907064
plot(x,y,type="p",xlim=c(0,1.5),ylim=c(1,5),main=c("Figure
showing true value, predicted value \n in red and CI for slope in
green color"))
par(new=TRUE)
plot(x,model$fitted,type="p",lwd=0.1,col="red",xlim=c(0,1.5),ylim=c(1,5),xlab=NA,ylab=NA)
par(new=TRUE)
plot(x,model$fitted,type="l",lwd=0.1,col="red",xlim=c(0,1.5),ylim=c(1,5),xlab=NA,ylab=NA)
par(new=TRUE)
plot(x,
(A+B_L*x),type="l",col="green",xlim=c(0,1.5),ylim=c(1,5),xlab=NA,ylab=NA)
par(new=TRUE)
plot(x,
(A+B_U*x),type="l",col="green",xlim=c(0,1.5),ylim=c(1,5),xlab=NA,ylab=NA)
###### Interpretation #########3
The regression is significant since the p-value is 0.01108
(<0.05) at 5% level of significance.
Also, the covariate predator mass has significant effect on the
response and the impact is
negative. The R^2 value is 0.458, which is not so high, imply that
the model can explain
45.8% variability contained in the responses.