Hipotesis cientifica:Es posible inhibir el crecimiento de el hongo en las plantas(Solanum tuberosum) con el uso de un fungicida que es capaz de eliminar el hongo de la papa(Phytophthora infestans)

Hipotesis estadisticas: Hipotesis nula:El fungicida no diminuyo el crecimiento del hongo de las plantas. Hipotesis alternativa: El fungicida logro disminuir el crecimiento del hongo de las plantas

datos= read.table("C:\\Users\\USUARIO\\Downloads\\Diametros P_infestans.txt", header = T)
datos
##     Tratamiento Diametro_halo
## 1       Control          4.33
## 2       Control         15.86
## 3       Control         12.52
## 4       Control         18.00
## 5       Control          5.16
## 6       Control          8.78
## 7       Control         11.53
## 8       Control         20.00
## 9       Control         10.81
## 10      Control          8.68
## 11      Control         13.00
## 12      Control         10.34
## 13      Control         10.00
## 14      Control         19.91
## 15      Control         10.60
## 16      Control         13.36
## 17      Control          9.11
## 18      Control         17.69
## 19      Control         11.00
## 20      Control         14.42
## 21      Control         16.00
## 22      Control          8.23
## 23      Control         13.57
## 24      Control          9.81
## 25      Control         13.49
## 26      Control         15.04
## 27      Control          5.29
## 28      Control         20.93
## 29      Control          8.05
## 30      Control         15.18
## 31      Control          7.59
## 32      Control          6.87
## 33      Control          9.42
## 34      Control          5.03
## 35      Control         15.18
## 36      Control          6.39
## 37      Control         11.43
## 38      Control          3.04
## 39      Control          6.56
## 40      Control         17.45
## 41      Control          9.14
## 42      Control         14.00
## 43      Control          5.87
## 44      Control         14.06
## 45      Control          6.98
## 46      Control         13.45
## 47      Control          8.76
## 48      Control         19.76
## 49      Control         10.13
## 50      Control         10.04
## 51      Control          4.76
## 52      Control         13.09
## 53      Control          7.78
## 54      Control          5.64
## 55      Control         13.04
## 56      Control         15.42
## 57      Control          9.13
## 58      Control          9.56
## 59      Control         10.29
## 60      Control         13.56
## 61      Control         10.65
## 62      Control          6.41
## 63      Control          8.98
## 64      Control         17.29
## 65      Control         24.00
## 66      Control          4.04
## 67      Control          3.21
## 68      Control          8.42
## 69      Control          8.06
## 70      Control         16.87
## 71      Control         12.98
## 72      Control          5.07
## 73      Control         13.46
## 74      Control         12.65
## 75      Control          6.84
## 76      Control          6.93
## 77      Control          5.54
## 78      Control         11.42
## 79      Control          7.21
## 80      Control          9.01
## 81      Control         12.87
## 82      Control          6.51
## 83      Control         21.76
## 84      Control         10.08
## 85      Control         11.09
## 86      Control         15.65
## 87      Control          9.09
## 88      Control          8.52
## 89      Control          9.06
## 90      Control         16.32
## 91      Control          9.32
## 92      Control          9.98
## 93      Control          9.42
## 94      Control         17.54
## 95      Control          9.34
## 96      Control         15.19
## 97      Control          6.43
## 98      Control         22.00
## 99      Control          8.43
## 100     Control         10.42
## 101     Control         10.71
## 102     Control          8.16
## 103     Control          8.15
## 104     Control          7.33
## 105     Control         11.03
## 106     Control         11.68
## 107     Control          3.55
## 108     Control          6.31
## 109     Control         12.08
## 110     Control          2.36
## 111     Control          9.59
## 112     Control         15.21
## 113     Control          3.88
## 114     Control          9.12
## 115     Control         11.23
## 116     Control         18.13
## 117     Control          9.07
## 118     Control          6.12
## 119     Control         14.65
## 120     Control          6.18
## 121     Control         15.77
## 122     Control          2.45
## 123     Control          9.17
## 124     Control         12.14
## 125     Control          8.52
## 126     Control          5.44
## 127     Control         12.28
## 128     Control         10.48
## 129     Control          8.37
## 130     Control          9.98
## 131     Control          7.71
## 132     Control         12.75
## 133     Control          6.07
## 134     Control          9.97
## 135     Control         13.09
## 136     Control         20.65
## 137     Control         10.00
## 138     Control          4.75
## 139     Control         24.43
## 140     Control         14.43
## 141     Control         17.29
## 142     Control         16.78
## 143     Control          7.09
## 144     Control         22.96
## 145     Control          5.65
## 146     Control          5.79
## 147     Control          6.36
## 148     Control         18.42
## 149     Control          5.09
## 150     Control          3.33
## 151     Control         18.12
## 152     Control          4.98
## 153     Control          9.04
## 154     Control          4.77
## 155     Control         10.98
## 156     Control         20.54
## 157     Control         14.11
## 158     Control          7.09
## 159     Control         13.01
## 160     Control          5.66
## 161     Control         13.08
## 162     Control         16.45
## 163     Control         12.37
## 164     Control          9.65
## 165     Control          8.35
## 166     Control          6.87
## 167     Control         11.43
## 168     Control          8.98
## 169     Control          6.54
## 170     Control          6.12
## 171     Control         15.63
## 172     Control          6.28
## 173     Control          7.38
## 174     Control         16.54
## 175     Control         15.04
## 176     Control          9.36
## 177     Control          7.66
## 178     Control         12.32
## 179     Control         11.28
## 180     Control         12.18
## 181     Control         16.41
## 182     Control         21.59
## 183     Control         10.49
## 184     Control         15.01
## 185     Control          7.17
## 186     Control         11.39
## 187     Control         12.47
## 188     Control         11.16
## 189     Control         16.37
## 190     Control         15.37
## 191     Control         12.35
## 192     Control          6.37
## 193     Control          7.58
## 194     Control          7.36
## 195     Control          4.54
## 196     Control         11.13
## 197     Control         15.56
## 198     Control         17.43
## 199     Control         13.34
## 200     Control          6.04
## 201   Fungicida          5.00
## 202   Fungicida          4.37
## 203   Fungicida          6.01
## 204   Fungicida          2.36
## 205   Fungicida          3.16
## 206   Fungicida          2.67
## 207   Fungicida          2.16
## 208   Fungicida          3.44
## 209   Fungicida          6.49
## 210   Fungicida          4.41
## 211   Fungicida          7.75
## 212   Fungicida          5.84
## 213   Fungicida          1.62
## 214   Fungicida          3.66
## 215   Fungicida          8.56
## 216   Fungicida          4.95
## 217   Fungicida          6.68
## 218   Fungicida          2.81
## 219   Fungicida          2.23
## 220   Fungicida          6.20
## 221   Fungicida          4.76
## 222   Fungicida          2.49
## 223   Fungicida          4.40
## 224   Fungicida          5.32
## 225   Fungicida          6.01
## 226   Fungicida          7.58
## 227   Fungicida         21.38
## 228   Fungicida          3.89
## 229   Fungicida          4.40
## 230   Fungicida          4.99
## 231   Fungicida          4.19
## 232   Fungicida          5.30
## 233   Fungicida          6.58
## 234   Fungicida          5.23
## 235   Fungicida          2.41
## 236   Fungicida          8.59
## 237   Fungicida          3.83
## 238   Fungicida          7.83
## 239   Fungicida          4.51
## 240   Fungicida          2.61
## 241   Fungicida          3.50
## 242   Fungicida          5.94
## 243   Fungicida          4.85
## 244   Fungicida          4.15
## 245   Fungicida          4.61
## 246   Fungicida          3.70
## 247   Fungicida          2.20
## 248   Fungicida          3.55
## 249   Fungicida          5.49
## 250   Fungicida          2.95
## 251   Fungicida          9.97
## 252   Fungicida          2.48
## 253   Fungicida          4.76
## 254   Fungicida          5.39
## 255   Fungicida          5.09
## 256   Fungicida          8.13
## 257   Fungicida          3.65
## 258   Fungicida          5.29
## 259   Fungicida         12.74
## 260   Fungicida          5.61
## 261   Fungicida          2.92
## 262   Fungicida          3.62
## 263   Fungicida          6.65
## 264   Fungicida          3.31
## 265   Fungicida          6.08
## 266   Fungicida          3.88
## 267   Fungicida          9.28
## 268   Fungicida          2.99
## 269   Fungicida          4.17
## 270   Fungicida          3.94
## 271   Fungicida          7.97
## 272   Fungicida          6.58
## 273   Fungicida          2.91
## 274   Fungicida          3.55
## 275   Fungicida          9.76
## 276   Fungicida          3.34
## 277   Fungicida          5.66
## 278   Fungicida          6.66
## 279   Fungicida          2.01
## 280   Fungicida          5.02
## 281   Fungicida          8.29
## 282   Fungicida          7.02
## 283   Fungicida          3.80
## 284   Fungicida          2.89
## 285   Fungicida          5.38
## 286   Fungicida          9.19
## 287   Fungicida          1.97
## 288   Fungicida          5.03
## 289   Fungicida          4.60
## 290   Fungicida          4.41
## 291   Fungicida          3.01
## 292   Fungicida          5.69
## 293   Fungicida          4.37
## 294   Fungicida          4.05
## 295   Fungicida          6.28
## 296   Fungicida          7.19
## 297   Fungicida          9.53
## 298   Fungicida          5.40
## 299   Fungicida          1.77
## 300   Fungicida          2.78
## 301   Fungicida          4.82
## 302   Fungicida          4.94
## 303   Fungicida          6.65
## 304   Fungicida          3.80
## 305   Fungicida          5.96
## 306   Fungicida          2.76
## 307   Fungicida          3.58
## 308   Fungicida          7.06
## 309   Fungicida          1.61
## 310   Fungicida          2.97
## 311   Fungicida          5.51
## 312   Fungicida          7.49
## 313   Fungicida          2.76
## 314   Fungicida          7.73
## 315   Fungicida          5.32
## 316   Fungicida          1.92
## 317   Fungicida          4.71
## 318   Fungicida          4.36
## 319   Fungicida          2.37
## 320   Fungicida          8.39
## 321   Fungicida          3.03
## 322   Fungicida          1.72
## 323   Fungicida          6.16
## 324   Fungicida          2.09
## 325   Fungicida          7.25
## 326   Fungicida          2.06
control= subset(datos, Tratamiento=="Control")
control_sd= sd(control$Diametro_halo)
control_mean= mean(control$Diametro_halo)
control_mediana= median(control$Diametro_halo)

fungicida= subset(datos, Tratamiento=="Fungicida")
fungicida_sd= sd(fungicida$Diametro_halo)
fungicida_mean= mean(fungicida$Diametro_halo)
fungicida_mediana= median(fungicida$Diametro_halo)

Pruebas de normalidad en el tratamiento de control:

Hipotesis Shapiro Wilk Test: Hipotesis nula:Los datos siguen una distribucion normal Hipotesis alternativa: Los datos no siguen una distribucion normal

library(ggplot2)
control_hist=ggplot(control, aes(x=Diametro_halo)) + geom_histogram(bins=10, color="black") + theme_classic() + ggtitle("Histograma diametro del halo en el tratamiento de control")+ xlab("Diametro del halo grupo control") + ylab("Frecuencia")
control_hist

control_qq= ggplot()+ xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample =control$Diametro_halo) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1'))) + theme_minimal()
control_qq

shapiro.test(control$Diametro_halo)
## 
##  Shapiro-Wilk normality test
## 
## data:  control$Diametro_halo
## W = 0.96987, p-value = 0.0002718

En las pruebas de normalidad de puede evidenciar que no hay una distribucion en el tratamiento de control, debido a que se rechaza la hipotesis nula del Shapiro Wilk test y se logra evidenciar en el histograma como hay una desviacion a la derecha.

Debido a que el tratamiento dde control no tiene una distribucion normal se le aplican transformaciones en este caso la transformacion log(x) debido a que la desviacion es hacia la derecha.

control_trans= log(control$Diametro_halo)
shapiro.test(control_trans)
## 
##  Shapiro-Wilk normality test
## 
## data:  control_trans
## W = 0.98187, p-value = 0.01104

Luego de la transformacion no se logra evidenciar que no se rechaza la hipotesis nula de el Shapiro Wilk test.

Pruebas de normalidad en el tratamiento fungicida:

Hipotesis Shapiro Wilk Test: Hipotesis nula:Los datos siguen una distribucion normal Hipotesis alternativa: Los datos no siguen una distribucion normal

library(ggplot2)
fungicida_hist=ggplot(fungicida, aes(x=Diametro_halo)) + geom_histogram(bins=10, color="black") + theme_classic() + ggtitle("Histograma diametro del halo en el tratamiento de fungicida")+ xlab("Diametro del halo grupo fungicida") + ylab("Frecuencia")
fungicida_hist

fungicida_qq= ggplot()+ xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample =fungicida$Diametro_halo) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1'))) + theme_minimal()
fungicida_qq

shapiro.test(fungicida$Diametro_halo)
## 
##  Shapiro-Wilk normality test
## 
## data:  fungicida$Diametro_halo
## W = 0.83845, p-value = 1.974e-10

En las pruebas de normalidad de puede evidenciar que no hay una distribucion en el tratamiento de fungicida, debido a que se rechaza la hipotesis nula del Shapiro Wilk test.

Debido a que se el tratamiento de fungicida no tiene una distribucion normal, y a que al tratamiento de control se le aplico una transformacion, a este tratamiento tambien se le debe aplicar una transformacion.

fungicida_trans= log(fungicida$Diametro_halo)
shapiro.test(fungicida_trans)
## 
##  Shapiro-Wilk normality test
## 
## data:  fungicida_trans
## W = 0.98838, p-value = 0.3659

Luego de la transformacion no se logra evidenciar que no se rechaza la hipotesis nula de el Shapiro Wilk test.

-> El estadistico de prueba que vamos a usar es la mediana. -> Y el valor alfa que elegimos es 0.03 debido a que no queriamos un valor tan bajo para evitar errores de tipo II

Permutaciones tratamientos:

library(ggplot2)
mediana.diff.halo= control_mediana- fungicida_mediana

nPerm= 500000
diferencia_mediana= length(nPerm)
for(i in 1:499999){shuffle_numbers<-sample(x=datos$Diametro_halo, replace=F)
nuevo_control=shuffle_numbers[1:200]
nuevo_fungicida=shuffle_numbers[201:326]
diferencia_mediana[i]= (median(nuevo_control)- median(nuevo_fungicida))}

diferencia_mediana[nPerm]=mediana.diff.halo

nula_halo= data.frame(sim=1:50, diferencia_mediana)
ggplot(nula_halo, aes(x=diferencia_mediana)) + geom_histogram(bins=6, color="black")+ theme_classic()+ggtitle("Histograma de la diferencia de mediana") + xlab("Diferencia medianas")+ ylab("Frecuencia")+ theme(legend.position = "none")

pValue = 2*((sum(nula_halo <=mediana.diff.halo))/(nPerm))
pValue
## [1] 2.2

Teniendo en cuenta el valor-p y el valor de significacia se puede deducir que no se rechaza la hipoteis nula.

Boostrap de los tratamientos:

library(ggplot2)
n_boot= 500000
##Control
mediana_bootstrap_control= numeric(length=n_boot)
for (i in 1:n_boot) {bootstrap_control= sample(control$Diametro_halo, replace=T)
mediana_bootstrap_control[i]= median(bootstrap_control)
}
IC_99_inf_control= quantile(mediana_bootstrap_control, 0.001)
IC_99_sup_control= quantile(mediana_bootstrap_control, 0.995)

ggplot()+ aes(mediana_bootstrap_control)+ geom_histogram(bins=20, color='#FFFFFF', fill='#a387a2')+ggtitle("Medianas Bootstrap tratamiento control") + geom_vline(aes(xintercept= IC_99_inf_control, color="IC_99"), linetype="longdash",size=1)+ geom_vline(aes(xintercept= IC_99_sup_control, color="IC_99"), linetype="longdash",size=1)+labs(x="Medianas Calculadas por Bootstrap", y="Frecuencia")+scale_color_manual(name='', breaks=c("IC_99"), labels=c( "IC 99%"), values=c(IC_99='#1b9e77'))+ cowplot::theme_half_open()+ theme(legend.position = "bottom")

mediana_bootstrap_fungicida= numeric(length=n_boot)

for (a in 1:n_boot) {bootstrap_fungicida= sample(fungicida$Diametro_halo, replace=T)
mediana_bootstrap_fungicida[a]= median(bootstrap_fungicida)
}

IC_99_inf_fungicida= quantile(mediana_bootstrap_fungicida, 0.001)
IC_99_sup_fungicida= quantile(mediana_bootstrap_fungicida, 0.995)

ggplot()+ aes(mediana_bootstrap_fungicida)+ geom_histogram(bins=20, color='#FFFFFF', fill='#a387a2')+ggtitle("Medianas Bootstrap tratamiento fungicida") + geom_vline(aes(xintercept= IC_99_inf_fungicida, color="IC_99"), linetype="longdash",size=1)+ geom_vline(aes(xintercept= IC_99_sup_fungicida, color="IC_99"), linetype="longdash",size=1)+labs(x="Medianas Calculadas por Bootstrap", y="Frecuencia")+scale_color_manual(name='', breaks=c("IC_99"), labels=c( "IC 99%"), values=c(IC_99='#1b9e77'))+ cowplot::theme_half_open()+ theme(legend.position = "bottom")

Prueba de t-test: La prueba es una prueba t-test de datos independientes debido a que se deben analizar dos tratamientos diferentes el de control y el de fungicida. Debido a que es una prueba de dos datos independientes primero se debe hacer una prueba f con el objetivo de evidenciar si las varianzas de ambos tratamientos son iguales

datos_trans= data.frame("Tratamientos"=c(control$Tratamiento, fungicida$Tratamiento), "Diametro_halo"=c(control_trans, fungicida_trans))
datos_trans
##     Tratamientos Diametro_halo
## 1        Control     1.4655675
## 2        Control     2.7638002
## 3        Control     2.5273274
## 4        Control     2.8903718
## 5        Control     1.6409366
## 6        Control     2.1724764
## 7        Control     2.4449523
## 8        Control     2.9957323
## 9        Control     2.3804716
## 10       Control     2.1610215
## 11       Control     2.5649494
## 12       Control     2.3360199
## 13       Control     2.3025851
## 14       Control     2.9912221
## 15       Control     2.3608540
## 16       Control     2.5922652
## 17       Control     2.2093727
## 18       Control     2.8729995
## 19       Control     2.3978953
## 20       Control     2.6686161
## 21       Control     2.7725887
## 22       Control     2.1077860
## 23       Control     2.6078615
## 24       Control     2.2834023
## 25       Control     2.6019487
## 26       Control     2.7107133
## 27       Control     1.6658182
## 28       Control     3.0411835
## 29       Control     2.0856721
## 30       Control     2.7199788
## 31       Control     2.0268316
## 32       Control     1.9271641
## 33       Control     2.2428351
## 34       Control     1.6154200
## 35       Control     2.7199788
## 36       Control     1.8547343
## 37       Control     2.4362415
## 38       Control     1.1118575
## 39       Control     1.8809906
## 40       Control     2.8593396
## 41       Control     2.2126604
## 42       Control     2.6390573
## 43       Control     1.7698546
## 44       Control     2.6433339
## 45       Control     1.9430489
## 46       Control     2.5989791
## 47       Control     2.1701959
## 48       Control     2.9836597
## 49       Control     2.3155013
## 50       Control     2.3065771
## 51       Control     1.5602477
## 52       Control     2.5718486
## 53       Control     2.0515563
## 54       Control     1.7298841
## 55       Control     2.5680216
## 56       Control     2.7356654
## 57       Control     2.2115657
## 58       Control     2.2575877
## 59       Control     2.3311725
## 60       Control     2.6071243
## 61       Control     2.3655599
## 62       Control     1.8578593
## 63       Control     2.1949999
## 64       Control     2.8501283
## 65       Control     3.1780538
## 66       Control     1.3962447
## 67       Control     1.1662709
## 68       Control     2.1306098
## 69       Control     2.0869136
## 70       Control     2.8255369
## 71       Control     2.5634097
## 72       Control     1.6233408
## 73       Control     2.5997223
## 74       Control     2.5376572
## 75       Control     1.9227877
## 76       Control     1.9358598
## 77       Control     1.7119945
## 78       Control     2.4353662
## 79       Control     1.9754690
## 80       Control     2.1983351
## 81       Control     2.5548990
## 82       Control     1.8733395
## 83       Control     3.0800734
## 84       Control     2.3105533
## 85       Control     2.4060438
## 86       Control     2.7504709
## 87       Control     2.2071749
## 88       Control     2.1424163
## 89       Control     2.2038691
## 90       Control     2.7923913
## 91       Control     2.2321626
## 92       Control     2.3005831
## 93       Control     2.2428351
## 94       Control     2.8644840
## 95       Control     2.2343063
## 96       Control     2.7206373
## 97       Control     1.8609745
## 98       Control     3.0910425
## 99       Control     2.1317968
## 100      Control     2.3437270
## 101      Control     2.3711779
## 102      Control     2.0992442
## 103      Control     2.0980179
## 104      Control     1.9919755
## 105      Control     2.4006188
## 106      Control     2.4578780
## 107      Control     1.2669476
## 108      Control     1.8421357
## 109      Control     2.4915512
## 110      Control     0.8586616
## 111      Control     2.2607209
## 112      Control     2.7219531
## 113      Control     1.3558352
## 114      Control     2.2104698
## 115      Control     2.4185888
## 116      Control     2.8975680
## 117      Control     2.2049723
## 118      Control     1.8115621
## 119      Control     2.6844403
## 120      Control     1.8213183
## 121      Control     2.7581094
## 122      Control     0.8960880
## 123      Control     2.2159373
## 124      Control     2.4965058
## 125      Control     2.1424163
## 126      Control     1.6937791
## 127      Control     2.5079719
## 128      Control     2.3494687
## 129      Control     2.1246539
## 130      Control     2.3005831
## 131      Control     2.0425182
## 132      Control     2.5455313
## 133      Control     1.8033586
## 134      Control     2.2995806
## 135      Control     2.5718486
## 136      Control     3.0277153
## 137      Control     2.3025851
## 138      Control     1.5581446
## 139      Control     3.1958119
## 140      Control     2.6693094
## 141      Control     2.8501283
## 142      Control     2.8201877
## 143      Control     1.9586853
## 144      Control     3.1337536
## 145      Control     1.7316555
## 146      Control     1.7561323
## 147      Control     1.8500284
## 148      Control     2.9134370
## 149      Control     1.6272778
## 150      Control     1.2029723
## 151      Control     2.8970163
## 152      Control     1.6054299
## 153      Control     2.2016592
## 154      Control     1.5623463
## 155      Control     2.3960754
## 156      Control     3.0223742
## 157      Control     2.6468838
## 158      Control     1.9586853
## 159      Control     2.5657183
## 160      Control     1.7334239
## 161      Control     2.5710843
## 162      Control     2.8003255
## 163      Control     2.5152742
## 164      Control     2.2669579
## 165      Control     2.1222615
## 166      Control     1.9271641
## 167      Control     2.4362415
## 168      Control     2.1949999
## 169      Control     1.8779372
## 170      Control     1.8115621
## 171      Control     2.7491921
## 172      Control     1.8373700
## 173      Control     1.9987736
## 174      Control     2.8057817
## 175      Control     2.7107133
## 176      Control     2.2364453
## 177      Control     2.0360120
## 178      Control     2.5112240
## 179      Control     2.4230312
## 180      Control     2.4997953
## 181      Control     2.7978909
## 182      Control     3.0722302
## 183      Control     2.3504224
## 184      Control     2.7087166
## 185      Control     1.9699057
## 186      Control     2.4327358
## 187      Control     2.5233258
## 188      Control     2.4123360
## 189      Control     2.7954504
## 190      Control     2.7324176
## 191      Control     2.5136561
## 192      Control     1.8515995
## 193      Control     2.0255132
## 194      Control     1.9960599
## 195      Control     1.5129270
## 196      Control     2.4096442
## 197      Control     2.7447035
## 198      Control     2.8581929
## 199      Control     2.5907670
## 200      Control     1.7984040
## 201    Fungicida     1.6094379
## 202    Fungicida     1.4747630
## 203    Fungicida     1.7934247
## 204    Fungicida     0.8586616
## 205    Fungicida     1.1505720
## 206    Fungicida     0.9820785
## 207    Fungicida     0.7701082
## 208    Fungicida     1.2354715
## 209    Fungicida     1.8702625
## 210    Fungicida     1.4838747
## 211    Fungicida     2.0476928
## 212    Fungicida     1.7647308
## 213    Fungicida     0.4824261
## 214    Fungicida     1.2974631
## 215    Fungicida     2.1471002
## 216    Fungicida     1.5993876
## 217    Fungicida     1.8991180
## 218    Fungicida     1.0331845
## 219    Fungicida     0.8020016
## 220    Fungicida     1.8245493
## 221    Fungicida     1.5602477
## 222    Fungicida     0.9122827
## 223    Fungicida     1.4816045
## 224    Fungicida     1.6714733
## 225    Fungicida     1.7934247
## 226    Fungicida     2.0255132
## 227    Fungicida     3.0624559
## 228    Fungicida     1.3584092
## 229    Fungicida     1.4816045
## 230    Fungicida     1.6074359
## 231    Fungicida     1.4327007
## 232    Fungicida     1.6677068
## 233    Fungicida     1.8840347
## 234    Fungicida     1.6544113
## 235    Fungicida     0.8796267
## 236    Fungicida     2.1505987
## 237    Fungicida     1.3428648
## 238    Fungicida     2.0579625
## 239    Fungicida     1.5062972
## 240    Fungicida     0.9593502
## 241    Fungicida     1.2527630
## 242    Fungicida     1.7817091
## 243    Fungicida     1.5789787
## 244    Fungicida     1.4231083
## 245    Fungicida     1.5282279
## 246    Fungicida     1.3083328
## 247    Fungicida     0.7884574
## 248    Fungicida     1.2669476
## 249    Fungicida     1.7029283
## 250    Fungicida     1.0818052
## 251    Fungicida     2.2995806
## 252    Fungicida     0.9082586
## 253    Fungicida     1.5602477
## 254    Fungicida     1.6845454
## 255    Fungicida     1.6272778
## 256    Fungicida     2.0955609
## 257    Fungicida     1.2947272
## 258    Fungicida     1.6658182
## 259    Fungicida     2.5447467
## 260    Fungicida     1.7245507
## 261    Fungicida     1.0715836
## 262    Fungicida     1.2864740
## 263    Fungicida     1.8946169
## 264    Fungicida     1.1969482
## 265    Fungicida     1.8050047
## 266    Fungicida     1.3558352
## 267    Fungicida     2.2278615
## 268    Fungicida     1.0952734
## 269    Fungicida     1.4279160
## 270    Fungicida     1.3711807
## 271    Fungicida     2.0756845
## 272    Fungicida     1.8840347
## 273    Fungicida     1.0681531
## 274    Fungicida     1.2669476
## 275    Fungicida     2.2782924
## 276    Fungicida     1.2059708
## 277    Fungicida     1.7334239
## 278    Fungicida     1.8961195
## 279    Fungicida     0.6981347
## 280    Fungicida     1.6134299
## 281    Fungicida     2.1150500
## 282    Fungicida     1.9487632
## 283    Fungicida     1.3350011
## 284    Fungicida     1.0612565
## 285    Fungicida     1.6826884
## 286    Fungicida     2.2181159
## 287    Fungicida     0.6780335
## 288    Fungicida     1.6154200
## 289    Fungicida     1.5260563
## 290    Fungicida     1.4838747
## 291    Fungicida     1.1019401
## 292    Fungicida     1.7387102
## 293    Fungicida     1.4747630
## 294    Fungicida     1.3987169
## 295    Fungicida     1.8373700
## 296    Fungicida     1.9726912
## 297    Fungicida     2.2544447
## 298    Fungicida     1.6863990
## 299    Fungicida     0.5709795
## 300    Fungicida     1.0224509
## 301    Fungicida     1.5727739
## 302    Fungicida     1.5973653
## 303    Fungicida     1.8946169
## 304    Fungicida     1.3350011
## 305    Fungicida     1.7850705
## 306    Fungicida     1.0152307
## 307    Fungicida     1.2753628
## 308    Fungicida     1.9544451
## 309    Fungicida     0.4762342
## 310    Fungicida     1.0885620
## 311    Fungicida     1.7065646
## 312    Fungicida     2.0135688
## 313    Fungicida     1.0152307
## 314    Fungicida     2.0451089
## 315    Fungicida     1.6714733
## 316    Fungicida     0.6523252
## 317    Fungicida     1.5496879
## 318    Fungicida     1.4724721
## 319    Fungicida     0.8628900
## 320    Fungicida     2.1270405
## 321    Fungicida     1.1085626
## 322    Fungicida     0.5423243
## 323    Fungicida     1.8180768
## 324    Fungicida     0.7371641
## 325    Fungicida     1.9810015
## 326    Fungicida     0.7227060
#Prueba F
var.test(datos_trans$Diametro_halo ~ datos_trans$Tratamientos, conf.level=0.99)
## 
##  F test to compare two variances
## 
## data:  datos_trans$Diametro_halo by datos_trans$Tratamientos
## F = 0.94794, num df = 199, denom df = 125, p-value = 0.7311
## alternative hypothesis: true ratio of variances is not equal to 1
## 99 percent confidence interval:
##  0.6187287 1.4274583
## sample estimates:
## ratio of variances 
##           0.947942

Las varianzas de ambos tratamientos son iguales con un nivel de confianza de 99% por lo que se hace una prueba t de dos datos independientes.

t.test(datos_trans$Diametro_halo ~ datos_trans$Tratamientos, var.equal=T, alternative="greater", conf.level=0.99)
## 
##  Two Sample t-test
## 
## data:  datos_trans$Diametro_halo by datos_trans$Tratamientos
## t = 15.06, df = 324, p-value < 2.2e-16
## alternative hypothesis: true difference in means is greater than 0
## 99 percent confidence interval:
##  0.6709908       Inf
## sample estimates:
##   mean in group Control mean in group Fungicida 
##                2.293748                1.499455

Teniendo en cuenta los resultados del t-test podemos deducir que la hipotesis nula se rechaza debido a que el valor t observado(t=15.06) es mayor que el valor critico evidenciado.

Prueba no parametrica de Wilcox:

wilcox.test(data= datos, Diametro_halo~Tratamiento, conf.level=0.99)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Diametro_halo by Tratamiento
## W = 22366, p-value < 2.2e-16
## alternative hypothesis: true location shift is not equal to 0

Teniendo en cuenta los resultados del Wilcox-test, podemos deducir que la hipotesis nula se rechaza para un nivel de confianza de 99%.

Graficas de los datos transformados:

Boxplot:

library(ggplot2)
Tratamiento <- c(datos_trans$Tratamientos) 
Halo <- c(datos_trans$Diametro_halo) 

tratamiento_halo_df <- data.frame(Tratamiento,Halo) 

posicion_boxplot<-boxplot(datos_trans$Diametro_halo~datos_trans$Tratamientos,
                          names = c ("Control", "Fungicida"), boxwex=0.4, bch=1,
                          xlab = "Diametro Halo",
                          ylab = "Tratamiento",
                          outline = TRUE)
stripchart(datos_trans$Diametro_halo~datos_trans$Tratamientos,
           data=tratamiento_halo_df,
           vertical = T,
           log = "y",
           boxwex = 0.25, bch = 1,
           method = "jitter",
           jitter = 0.2,
           cex = 0.5, pch = 16,
           col = rainbow(6),
           add = T)
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "boxwex" is not a
## graphical parameter
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "bch" is not a graphical
## parameter
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "boxwex" is not a
## graphical parameter
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "bch" is not a graphical
## parameter

Violin plot:

library(ggplot2)
boxplot_position <- ggplot(tratamiento_halo_df, aes(x=datos_trans$Tratamientos,
                                                     y=datos_trans$Diametro_halo)) +
  geom_violin(aes(fill= datos_trans$Tratamientos)) +
  scale_fill_manual(values=c("#0000CC","#CC0000")) +
  labs(title="",
       subtitle="",
       caption="",
       x="Tratamiento",
       y="Diametro de halo") +
  guides(fill = guide_legend(title = "Tratamiento")) + theme_classic()
boxplot_position + geom_boxplot(width=0.3) 

En ambos graficos de logra evidenciar como el diametro del halo es mayor en el tratamiento de control que en el de fungicida por lo que podemos deducir que el fungicida si es efectivo al disminuir el diametro del halo del hongo. Sin embargo tambien hay que tener en cuenta que el tratamiento del fungicida 74 plantas no sobrevivieron por lo que se deberia hacer otro experimento para ver si el fungicida estuvo relacionado con esto.