| title: “ANCOVA JUPR” |
| author: “Juan Pablo Ruiz Rugeles” |
| date: “29/4/2021” |
| output: html_document |
###10 ideas articulo relacion calcio magnesio en el suelo 1. La aplicacion de enmiendas para recuperar el balance entre estos dos elementos puede ayudar a recuperar el ph 2.La cantidad de Mg y Ca disponible en el suelo tiene que ver directamente con la meteorizacion 3.Magnesio se encuenta en menor proporcion que calcio 4. Magnesio participa en fotosintesis 5.Calcio de vital importancia para la planta; participa en elongacion y division celular 6.En suelos arenosos y con baja CIC es normal ver bajos niveles de Mg 7.Calcio es el cation que domina el componenete que la planta puede abosorver en un suelo que no es acido o no tiene altos niveles de aluminio 8.Cuando el calcio disminuye en el suelo aumenta la presencia de metales como Zny Mg 9.En agroforestales la mayor perdida de calcio se da por la tala de los arboles. 10.Actualmente la mejor relacion calcio magnesio en el suelo va desde 1/1 a 15/1
###Fosforo como covariable en un analisis de rendimiento de cacao agroforestal en asociacion con guamo Covariable= fosforo (ppm)
variable respuesta = rendimiento Tratamientos =
T0= control ( sin fertilizacion) t1= Hummus de lombriz (foliar y en riego) t2= biol (foliar y en riego) t3= bocashi (enterrado alrededor de cada arbol) Numero plantas lote = 10x10
####
Importancia del fosforo: macroelemento especialmente importante en maduraci?n y llenado de frutos. Contar con altos contenidos de este elemento, que participa activamente en el transporte de energ?a qu?mica entre la ra?z y el interior de la planta, resulta indispensable para alcanzar buenos rendimientos y calidad en la fruta.
###Interpretacion de restultados 1.AOV= Df Sum Sq Mean Sq F value Pr(>F) df\(fosforo 1 0.379 0.3795 1.801 0.183 df\)TRATAMIENTO 3 0.228 0.0760 0.361 0.781 Residuals 95 20.020 0.2107
Covariable no sirve el valor p es 18 entre 100, datos fosforo no es util para ajustar datos y los tratamientos no difieren mucho
2.Shapiro-Wilk normality test
data: ANCOVA_JUP$residuals W = 0.95566, p-value = 0.001996
Valor p indica que los residuales no tienen un comportamiento normal
3.Bartlett test of homogeneity of variances
data: df\(RTO and df\)TRATAMIENTO Bartlett’s K-squared = 1.9434, df = 3, p-value = 0.5842
la prueba dice que las varianzas son iguales
$expected [1] -0.01010101
$sd [1] 0.01048525
$p.value [1] 0.437021
$expected [1] -0.01010101
$sd [1] 0.01050187
$p.value [1] 0.451829
En los dos indices de Moran se Pueden rechazar las hip?tesis nulas porque el valor p es estadisticamente significativo. La distribuci?n espacial de los valores altos y los valores bajos en el dataset est? m?s agrupada espacialmente de lo que se esperar?a
No hay relacion clara entre el nivel de fosforo y el rendimiento aunque el tratamiento control tuvo un buen rendimiento y tambien buenos niveles de fosforo, lso tres tratamientos no tienen una diferencia verdaderamente significativa en cuanto al rendimiento aunque el tratamiento 2 de biol tuvo un mejor rendimiento que todos .
https://rpubs.com/about/getting-started
library(knitr)
## Warning: package 'knitr' was built under R version 4.0.5
library(ape)
## Warning: package 'ape' was built under R version 4.0.5
library(lattice)
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.0.5
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(readxl)
## Warning: package 'readxl' was built under R version 4.0.5
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.5
ANCOVA_JUP <- read_excel("ANCOVA JUP.xlsx")
View(ANCOVA_JUP)
ANCOVA_JUP$TRATAMIENTO = factor(ANCOVA_JUP$TRATAMIENTO)
df= ANCOVA_JUP
df %>% ggplot(aes( x= X, y=Y, colour=RTO))+
geom_point(size = 6,shape=18)+
scale_color_continuous(type = 'gradient')
df %>% ggplot(aes( x= X, y=Y, colour= fosforo))+
geom_point(size = 6,shape=18)+
scale_color_continuous(type = 'gradient')
tapply(df$RTO,df$TRATAMIENTO,mean)
## T0 T1 T2 T3
## 2.360884 2.235993 2.238701 2.262009
tapply(df$fosforo,df$TRATAMIENTO,mean)
## T0 T1 T2 T3
## 3.034598 2.799894 2.765210 3.260699
xyplot(df$RTO~df$fosforo, pch=19)
xyplot(df$RTO~df$fosforo|df$TRATAMIENTO, pch=19)
\[H_0: \mu_{T_0} = \mu_{T_1} =\mu_{T_2} =\mu_{T_3}\] \[H_0:\delta =0 \]
rriskDistributions::fit.cont(df$fosforo)
##
## Begin fitting distributions ---------------------------------------
## * fitting normal distribution ... OK
## * fitting Cauchy distribution ... OK
## * fitting logistic distribution ... OK
## * fitting beta distribution ... failed
## * fitting exponential distribution ... OK
## * fitting chi-square distribution ... OK
## * fitting uniform distribution ... OK
## * fitting gamma distribution ... OK
## * fitting lognormal distribution ... OK
## * fitting Weibull distribution ... OK
## * fitting F-distribution ... OK
## * fitting Student's t-distribution ... OK
## * fitting Gompertz distribution ... OK
## * fitting triangular distribution ... failed
## End fitting distributions -----------------------------------------
## logL AIC BIC Chisq(value) Chisq(p) AD(value) H(AD)
## Normal -152.05 308.11 313.32 9.17 0.33 0.65 not rejected
## Cauchy -177.72 359.43 364.64 21.85 0.01 2.05 rejected
## Logistic -155.73 315.45 320.66 9.22 0.32 0.75 rejected
## Exponential -208.69 419.38 421.99 91.93 0.00 17.17 rejected
## Chi-square -185.38 372.76 375.36 48.00 0.00 8.35 NULL
## Uniform NULL NULL NULL 10.93 0.21 Inf NULL
## Gamma -152.75 309.5 314.71 10.17 0.25 0.90 rejected
## Lognormal -156.09 316.18 321.39 14.15 0.08 1.46 rejected
## Weibull -150.16 304.32 309.53 8.56 0.38 0.55 not rejected
## F -238.68 481.36 486.57 188.19 0.00 41.55 NULL
## Student -332.34 666.69 669.29 615.21 0.00 103.72 NULL
## Gompertz -152.92 309.83 315.04 12.73 0.12 0.84 NULL
## KS(value) H(KS)
## Normal 0.06 not rejected
## Cauchy 0.12 not rejected
## Logistic 0.07 not rejected
## Exponential 0.30 rejected
## Chi-square 0.25 rejected
## Uniform 0.06 not rejected
## Gamma 0.07 not rejected
## Lognormal 0.09 not rejected
## Weibull 0.06 not rejected
## F 0.46 rejected
## Student 0.75 rejected
## Gompertz 0.07 not rejected
##
## Chosen continuous distribution is: Normal (norm)
## Fitted parameters are:
## mean sd
## 2.965100 1.106941
rriskDistributions::fit.cont(df$RTO)
##
## Begin fitting distributions ---------------------------------------
## * fitting normal distribution ... OK
## * fitting Cauchy distribution ... OK
## * fitting logistic distribution ... OK
## * fitting beta distribution ... failed
## * fitting exponential distribution ... OK
## * fitting chi-square distribution ... OK
## * fitting uniform distribution ... OK
## * fitting gamma distribution ... OK
## * fitting lognormal distribution ... OK
## * fitting Weibull distribution ... OK
## * fitting F-distribution ... OK
## * fitting Student's t-distribution ... OK
## * fitting Gompertz distribution ... OK
## * fitting triangular distribution ... failed
## End fitting distributions -----------------------------------------
## logL AIC BIC Chisq(value) Chisq(p) AD(value) H(AD)
## Normal -62.97 129.93 135.14 16.52 0.04 1.78 rejected
## Cauchy -92.9 189.8 195.01 45.62 0.00 3.10 rejected
## Logistic -67.82 139.64 144.85 19.39 0.01 1.78 rejected
## Exponential -182.17 366.34 368.95 245.90 0.00 29.24 rejected
## Chi-square -165.3 332.61 335.21 187.73 0.00 22.04 NULL
## Uniform NULL NULL NULL 4.47 0.81 0.50 NULL
## Gamma -63.9 131.8 137.01 18.52 0.02 2.01 rejected
## Lognormal -64.97 133.94 139.15 20.57 0.01 2.19 rejected
## Weibull -61.54 127.08 132.29 15.63 0.05 1.63 rejected
## F -193.34 390.68 395.89 316.40 0.00 56.08 NULL
## Student -292.12 586.25 588.85 991.71 0.00 124.60 NULL
## Gompertz -63.13 130.27 135.48 18.18 0.02 1.63 NULL
## KS(value) H(KS)
## Normal 0.09 not rejected
## Cauchy 0.16 rejected
## Logistic 0.09 not rejected
## Exponential 0.48 rejected
## Chi-square 0.42 rejected
## Uniform 0.06 not rejected
## Gamma 0.10 not rejected
## Lognormal 0.11 not rejected
## Weibull 0.09 not rejected
## F 0.62 rejected
## Student 0.84 rejected
## Gompertz 0.09 not rejected
##
## Chosen continuous distribution is: Normal (norm)
## Fitted parameters are:
## mean sd
## 2.2743968 0.4541768
ANCOVA_JUP <- aov(df$RTO~df$fosforo+df$TRATAMIENTO)
summary(ANCOVA_JUP)
## Df Sum Sq Mean Sq F value Pr(>F)
## df$fosforo 1 0.379 0.3795 1.801 0.183
## df$TRATAMIENTO 3 0.228 0.0760 0.361 0.781
## Residuals 95 20.020 0.2107
shapiro.test(ANCOVA_JUP$residuals)
##
## Shapiro-Wilk normality test
##
## data: ANCOVA_JUP$residuals
## W = 0.95566, p-value = 0.001996
bartlett.test(df$RTO,df$TRATAMIENTO)
##
## Bartlett test of homogeneity of variances
##
## data: df$RTO and df$TRATAMIENTO
## Bartlett's K-squared = 1.9434, df = 3, p-value = 0.5842
ANCOVA.dists <- as.matrix(dist(cbind(df$X, df$Y)))
ANCOVA.dists.inv <- 1/ANCOVA.dists
diag(ANCOVA.dists.inv) <- 0
Moran.I(df$RTO, ANCOVA.dists.inv)
## $observed
## [1] -0.0180023
##
## $expected
## [1] -0.01010101
##
## $sd
## [1] 0.01050187
##
## $p.value
## [1] 0.451829
Moran.I(df$fosforo, ANCOVA.dists.inv)
## $observed
## [1] -0.001951521
##
## $expected
## [1] -0.01010101
##
## $sd
## [1] 0.01048525
##
## $p.value
## [1] 0.437021