Se aplico la prueba de Shapiro Test para determinar la normalidad de los datos de Abundancia, Temperatura y Velocidad del viento en cada una de las cuatro especies. También, se aplicó la prueba de Correlación (cor.test) relacionando la Abundancia con la Temperatura, y por otro lado, la abundancia y Velocidad del viento.
Además, tomando los valores de la Temperatura y Abundancia de la especie Artibeus jamaicensis se realizo una regresión líneal(y=mx+b) para la predicción en donde al aumentar la temperatura aumentra la abundancia de la especie. Para todos los pruebas estadísticas se utilizó la interfaz de programación de Rstudio.
library(readxl)
dat2 <- read_excel("C:/Users/Usuario/Documents/bdc.xlsx", sheet = "Muestreo")
dat1 <- data.frame(dat2)
Temp<- dat1$temp_aire[dat1$especie=="artibeus_sp1"]
abund<- dat1$N[dat1$especie=="artibeus_sp1"]
shapiro.test(Temp)
##
## Shapiro-Wilk normality test
##
## data: Temp
## W = 0.927, p-value = 1.573e-14
shapiro.test(abund)
##
## Shapiro-Wilk normality test
##
## data: abund
## W = 0.95337, p-value = 3.589e-11
cor.test( Temp, abund, method = "s")
## Warning in cor.test.default(Temp, abund, method = "s"): Cannot compute exact p-
## value with ties
##
## Spearman's rank correlation rho
##
## data: Temp and abund
## S = 19757237, p-value = 0.1157
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.07190335
Temp2<- dat1$temp_aire[dat1$especie=="artibeus_sp2"]
abund2<- dat1$N[dat1$especie=="artibeus_sp2"]
shapiro.test(Temp2)
##
## Shapiro-Wilk normality test
##
## data: Temp2
## W = 0.92498, p-value = 9.454e-15
shapiro.test(abund2)
##
## Shapiro-Wilk normality test
##
## data: abund2
## W = 0.94974, p-value = 1.067e-11
cor.test( Temp2, abund2, method = "s")
## Warning in cor.test.default(Temp2, abund2, method = "s"): Cannot compute exact
## p-value with ties
##
## Spearman's rank correlation rho
##
## data: Temp2 and abund2
## S = 19097256, p-value = 0.4301
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.03609693
Temp3<- dat1$temp_aire[dat1$especie=="thyroptera_sp1"]
abund3<- dat1$N[dat1$especie=="thyroptera_sp1"]
shapiro.test(Temp3)
##
## Shapiro-Wilk normality test
##
## data: Temp3
## W = 0.91795, p-value = 1.737e-15
shapiro.test(abund3)
##
## Shapiro-Wilk normality test
##
## data: abund3
## W = 0.95226, p-value = 2.463e-11
cor.test( Temp3, abund3, method = "s")
## Warning in cor.test.default(Temp3, abund3, method = "s"): Cannot compute exact
## p-value with ties
##
## Spearman's rank correlation rho
##
## data: Temp3 and abund3
## S = 18752741, p-value = 0.7037
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.01740575
Temp4<- dat1$temp_aire[dat1$especie=="thyroptera_sp2"]
abund4<- dat1$N[dat1$especie=="thyroptera_sp2"]
shapiro.test(Temp4)
##
## Shapiro-Wilk normality test
##
## data: Temp4
## W = 0.9175, p-value = 1.563e-15
shapiro.test(abund4)
##
## Shapiro-Wilk normality test
##
## data: abund4
## W = 0.95473, p-value = 5.75e-11
cor.test( Temp4, abund4, method = "s")
## Warning in cor.test.default(Temp4, abund4, method = "s"): Cannot compute exact
## p-value with ties
##
## Spearman's rank correlation rho
##
## data: Temp4 and abund4
## S = 17352529, p-value = 0.2003
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.05856095
#Regresión
reg1<-data.frame(Temp, abund)
r1<- lm(abund~Temp, data = reg1)
summary(r1)
##
## Call:
## lm(formula = abund ~ Temp, data = reg1)
##
## Residuals:
## Min 1Q Median 3Q Max
## -19.9724 -9.6165 -0.7605 10.1125 21.5194
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 27.736 5.200 5.333 1.49e-07 ***
## Temp -0.356 0.229 -1.554 0.121
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.29 on 478 degrees of freedom
## Multiple R-squared: 0.00503, Adjusted R-squared: 0.002948
## F-statistic: 2.416 on 1 and 478 DF, p-value: 0.1207
plot(r1)
library(ggplot2)
ggplot(r1, aes(x=Temp,y=abund))+geom_point(shape=1)+geom_smooth(method=lm)
## `geom_smooth()` using formula 'y ~ x'
library(visreg)
V<-visreg(r1, "Temp", partial=F)
## Resultados ### Correlaciones
Para la especie “artibeus_sp1” se obtuvo una correlación muy débil negativa (rho=-0.07190335) y no significativa con un p-value de 0.1157, lo que indica que apenas el 0.005170092 de los datos están relacionados. Para la especie “artibeus_sp2” se obtuvo una correlación muy débil negativa (rho=-0.03609693 ) y no significativa con un p-value de 0.4301, siendo así, que solo el 0.001302988 de los datos se encuentran relacionados. Para la especie “thyroptera_sp1” se obtuvo una correlación muy débil negativa (rho= -0.01740575) y no significativa con un p-value de 0.7037, donde sólo el 0.0003029601 de los datos están relacionados. Para la especie “thyroptera_sp2” se obtuvo una correlación muy débil negativa (rho=0.05856095 ) y no significativa con un p-value de 0.2003, con un porcentaje de datos relacionados de apenas el 0.003429385 porciento.
El valor obtenido es cercano a 0 por lo tanto no se puede hacer una predicción con los datos de esas variables.