Escribiendo ecuaciones en LaTex. s corresponde a desviación estándar. \[ EE={s\over{\sqrt{n}}} \]
set.seed(2020) #Fijar semilla, los números se generan igual en todos los computadores
biom <- round(rnorm(120,4, 0.5),3); biom # Kilogramos de tomate. rnorm genera 120 datos que siguen una distribución normal, una media de 4 y s= 0.5 (parámetros). Rendimientos de 120 plantas seleccionadas al azar, de un lote.
## [1] 4.188 4.151 3.451 3.435 2.602 4.360 4.470 3.885 4.880 4.059 3.573 4.455
## [13] 4.598 3.814 3.938 4.900 4.852 2.481 2.856 4.029 5.087 4.549 4.159 3.963
## [25] 4.417 4.099 4.649 4.468 3.926 4.055 3.594 3.628 4.548 5.218 4.194 4.145
## [37] 3.857 4.038 3.720 4.224 4.454 3.747 3.849 3.637 3.410 4.127 3.815 4.011
## [49] 4.330 4.244 3.906 4.301 3.663 4.238 4.059 4.061 3.907 3.336 3.717 4.289
## [61] 4.955 4.125 3.201 5.601 4.478 4.184 4.461 3.897 4.046 4.084 4.398 4.823
## [73] 3.142 3.841 3.548 3.648 3.111 3.639 4.023 4.122 4.314 3.988 5.157 4.089
## [85] 3.488 5.137 3.055 4.547 4.923 4.261 3.234 3.030 4.243 4.623 3.891 3.610
## [97] 4.174 4.341 3.734 3.661 3.136 3.504 3.707 4.192 4.373 3.536 3.831 4.773
## [109] 4.133 4.150 3.839 4.718 4.503 3.140 4.149 3.588 3.400 3.362 3.938 5.083
hilera <- gl(10,12,120, paste0("h",1:10));hilera #paste0: usa la letra h, pega, y crea una secuencia con los números. gl() genera las hileras
## [1] h1 h1 h1 h1 h1 h1 h1 h1 h1 h1 h1 h1 h2 h2 h2 h2 h2 h2
## [19] h2 h2 h2 h2 h2 h2 h3 h3 h3 h3 h3 h3 h3 h3 h3 h3 h3 h3
## [37] h4 h4 h4 h4 h4 h4 h4 h4 h4 h4 h4 h4 h5 h5 h5 h5 h5 h5
## [55] h5 h5 h5 h5 h5 h5 h6 h6 h6 h6 h6 h6 h6 h6 h6 h6 h6 h6
## [73] h7 h7 h7 h7 h7 h7 h7 h7 h7 h7 h7 h7 h8 h8 h8 h8 h8 h8
## [91] h8 h8 h8 h8 h8 h8 h9 h9 h9 h9 h9 h9 h9 h9 h9 h9 h9 h9
## [109] h10 h10 h10 h10 h10 h10 h10 h10 h10 h10 h10 h10
## Levels: h1 h2 h3 h4 h5 h6 h7 h8 h9 h10
sdbiom <- sd(biom); sdbiom # Desviación estándar de la biomasa
## [1] 0.5571457
n <-length(biom); n # Tamaño de la muestra
## [1] 120
EE <- sdbiom/sqrt(n); EE #¡Error estándar MAL!
## [1] 0.05086021
library(psych)
psych :: describe(biom)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 120 4.04 0.56 4.06 4.04 0.51 2.48 5.6 3.12 -0.03 0.22 0.05
mediabiom <- mean(biom); mediabiom
## [1] 4.037483
El anterior cálculo está mal porque el error estándar no aplica, ya que cada uno de los datos representa a una planta. De esos 20 datos sólo hay una media
El error estándar hace referencia a como varian los promedios. En este caso, no tiene sentido. NO APLICA.
describe.by(biom,hilera) # Los errores estándar de cada hilera por si sola, está mal
## Warning: describe.by is deprecated. Please use the describeBy function
##
## Descriptive statistics by group
## group: h1
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 3.96 0.61 4.11 4 0.53 2.6 4.88 2.28 -0.62 -0.4 0.18
## ------------------------------------------------------------
## group: h2
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 4.1 0.79 4.09 4.17 0.71 2.48 5.09 2.61 -0.69 -0.67 0.23
## ------------------------------------------------------------
## group: h3
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 4.25 0.45 4.17 4.21 0.4 3.59 5.22 1.62 0.43 -0.48 0.13
## ------------------------------------------------------------
## group: h4
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 3.91 0.28 3.85 3.9 0.25 3.41 4.45 1.04 0.2 -0.73 0.08
## ------------------------------------------------------------
## group: h5
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 4 0.31 4.06 4.04 0.31 3.34 4.33 0.99 -0.71 -0.73 0.09
## ------------------------------------------------------------
## group: h6
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 4.35 0.6 4.29 4.35 0.34 3.2 5.6 2.4 0.22 -0.14 0.17
## ------------------------------------------------------------
## group: h7
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 3.89 0.55 3.91 3.84 0.4 3.11 5.16 2.05 0.62 0.07 0.16
## ------------------------------------------------------------
## group: h8
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 4 0.73 4.07 3.99 0.84 3.03 5.14 2.11 0.05 -1.58 0.21
## ------------------------------------------------------------
## group: h9
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 3.91 0.46 3.78 3.91 0.5 3.14 4.77 1.64 0.19 -1.05 0.13
## ------------------------------------------------------------
## group: h10
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 12 4 0.58 4.04 3.98 0.68 3.14 5.08 1.94 0.25 -1.11 0.17
#Calculando el error estándar}
set.seed(2020)
BIOM <- replicate(100,rnorm(12,4,0.5)); BIOM
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,] 4.188486 4.598186 4.417134 3.857201 4.330022 4.954519 3.141538 3.487793
## [2,] 4.150774 3.814208 4.099375 4.038007 4.244397 4.125379 3.840828 5.137341
## [3,] 3.450988 3.938370 4.648921 3.719851 3.905605 3.200842 3.547930 3.055472
## [4,] 3.434797 4.900022 4.468359 4.223594 4.300680 5.600816 3.648004 4.546976
## [5,] 2.601733 4.851998 3.926283 4.454251 3.663120 4.477618 3.110950 4.923084
## [6,] 4.360287 2.480618 4.055216 3.747470 4.238025 4.184322 3.638872 4.260516
## [7,] 4.469561 2.855513 3.593748 3.849498 4.059377 4.461460 4.023077 3.233519
## [8,] 3.885311 4.029152 3.628149 3.636982 4.060613 3.897239 4.121829 3.030318
## [9,] 4.879566 5.087183 4.547673 3.409961 3.906977 4.046483 4.314166 4.243458
## [10,] 4.058683 4.549091 5.217687 4.126537 3.335864 4.084131 3.987681 4.622618
## [11,] 3.573439 4.159110 4.194059 3.814644 3.716539 4.397920 5.157077 3.891363
## [12,] 4.454630 3.963426 4.145314 4.011090 4.289417 4.823003 4.088605 3.610203
## [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16]
## [1,] 4.174437 4.133254 3.843859 3.951200 4.231833 3.436074 3.052156 3.861994
## [2,] 4.340862 4.149767 4.183720 3.938276 3.868894 4.025225 4.423346 4.424261
## [3,] 3.734269 3.838599 4.634720 3.477660 3.432143 3.658650 4.622013 3.475533
## [4,] 3.661303 4.717674 2.867573 3.962565 4.105650 4.324027 4.118130 3.133207
## [5,] 3.135608 4.503264 3.355075 4.880068 4.049714 4.305182 3.619653 5.207070
## [6,] 3.504370 3.140293 4.093943 3.283940 2.471658 3.743672 4.386110 3.902179
## [7,] 3.707247 4.149460 4.375821 5.331101 3.826432 4.377203 4.330778 4.463393
## [8,] 4.191761 3.587637 4.892341 3.354404 3.026687 4.094052 3.203133 3.643268
## [9,] 4.373332 3.400205 4.754136 4.007551 3.891962 3.035857 2.904827 3.350129
## [10,] 3.535790 3.361806 3.523419 3.980160 3.275402 4.617911 3.411623 4.442148
## [11,] 3.830912 3.938411 4.051711 5.095720 4.172717 4.164139 4.525003 4.600321
## [12,] 4.772557 5.082971 3.697220 3.011781 4.094101 3.572543 3.997148 3.414830
## [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,] 4.380736 3.480723 3.489934 3.045920 4.022222 4.771659 3.920112 4.445922
## [2,] 4.435045 3.372059 4.461980 3.993012 4.015930 3.434883 3.320667 4.109591
## [3,] 3.636379 4.578511 3.447075 4.253158 5.268222 3.365509 3.248275 3.577628
## [4,] 4.313310 4.519338 3.728128 4.225178 4.797991 3.642507 3.951361 3.319330
## [5,] 3.454279 3.952381 4.282164 3.168738 4.066257 4.621999 4.483631 4.073931
## [6,] 3.741953 3.450853 3.299969 4.834907 3.874756 4.076313 3.849322 2.611676
## [7,] 4.008467 4.280177 3.929871 2.696794 2.996065 4.239433 2.792391 4.378899
## [8,] 4.330495 3.873486 3.927860 4.398785 4.733555 4.393100 3.387122 3.592464
## [9,] 3.635233 5.103550 3.615988 4.243346 3.835944 3.492791 3.687542 4.525116
## [10,] 4.425689 3.628479 4.319124 4.339676 3.602734 3.170271 3.512178 3.803734
## [11,] 3.801754 4.223180 4.559359 4.069183 3.999017 3.902024 2.806643 4.005277
## [12,] 4.203339 4.052848 4.222930 4.847490 3.697043 4.280279 5.116794 4.491271
## [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32]
## [1,] 4.441026 4.458338 4.116300 4.349117 4.021108 4.071539 4.553105 4.096172
## [2,] 2.934749 3.886550 4.210414 4.021931 3.512396 3.677346 2.722084 4.191766
## [3,] 2.444142 4.591101 3.967955 2.995191 3.788694 3.563274 3.385896 3.986066
## [4,] 3.691626 4.760744 3.777598 4.054294 3.747369 3.922966 3.939129 4.234389
## [5,] 4.629249 4.718989 3.886274 4.451076 3.335688 4.283055 4.340061 5.033769
## [6,] 3.886330 5.163651 3.394083 4.861298 3.623438 3.784726 3.965041 3.678361
## [7,] 4.162135 5.108940 3.747945 3.836628 3.483365 3.842595 5.300973 3.515063
## [8,] 3.654445 4.424101 4.253271 4.404872 4.052971 3.945905 3.926328 3.455477
## [9,] 3.739243 4.051519 4.064813 3.762019 4.361545 3.661180 4.254394 4.948284
## [10,] 4.910992 3.910145 3.745628 3.268961 3.446686 2.977368 3.040628 3.933340
## [11,] 3.524959 4.032727 3.854780 2.965148 4.113053 4.825751 4.503124 3.681268
## [12,] 3.713025 4.015732 4.402498 4.920854 3.921147 3.674588 3.795793 4.570944
## [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40]
## [1,] 3.442076 4.889466 3.647135 4.458926 4.414769 4.313724 4.033141 3.721237
## [2,] 4.286119 3.636584 3.898655 3.059342 3.485698 3.855899 3.605788 3.820484
## [3,] 3.204100 3.893489 3.811284 4.042160 4.504902 3.690384 3.982251 3.934598
## [4,] 3.383840 3.444947 4.146181 4.021066 4.163829 3.475270 3.994645 3.087640
## [5,] 4.592944 3.027532 3.829952 4.184686 3.916369 4.730484 4.668186 3.868618
## [6,] 3.689234 4.162736 4.156341 3.858727 4.080651 3.736977 4.105233 3.749062
## [7,] 4.317761 4.523200 3.908425 3.407325 3.564902 3.698118 4.154575 4.164394
## [8,] 4.222578 3.814100 3.940653 4.000955 3.830682 4.476719 4.630745 3.592729
## [9,] 4.009099 3.872826 4.541857 3.854539 3.650712 3.836595 3.729911 3.943280
## [10,] 3.878076 3.860684 3.675185 3.722512 4.021657 3.912536 4.615179 3.046018
## [11,] 3.871910 4.092587 3.319167 4.269361 3.174449 3.969831 4.273128 4.783226
## [12,] 4.479250 2.865999 3.860989 3.696235 4.776859 3.850415 3.183464 4.104342
## [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48]
## [1,] 3.527693 3.772535 4.770529 3.937683 4.401680 3.691665 3.856442 4.264987
## [2,] 4.344027 4.193492 3.560947 4.044742 4.132812 3.597716 3.372146 4.774649
## [3,] 3.913805 3.219748 3.789638 4.013841 4.815665 4.161525 4.294913 3.938274
## [4,] 3.910205 3.993848 2.668771 3.972617 4.610303 3.925482 3.783226 4.296869
## [5,] 3.886290 3.819711 3.183848 4.050028 4.356624 5.107626 4.831002 5.220046
## [6,] 4.330859 3.600122 4.503493 4.257405 4.267754 3.578139 4.503443 3.596729
## [7,] 4.705028 3.998378 3.019208 3.755412 3.842747 3.793307 3.900959 3.752799
## [8,] 3.974876 5.147691 4.722709 3.933196 3.149193 3.940646 4.089519 4.304838
## [9,] 3.266015 4.603394 4.024119 3.561718 3.971050 4.454417 3.287257 4.197712
## [10,] 3.939824 3.988951 4.289324 3.337442 3.785789 3.971420 3.389981 4.457749
## [11,] 3.530774 4.595301 3.651418 3.262957 3.711255 4.337705 3.695647 3.348379
## [12,] 4.770609 4.053436 3.879847 4.205283 3.865733 3.661616 4.050411 3.183650
## [,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56]
## [1,] 5.225463 3.812392 4.119082 3.457145 3.443853 2.941713 4.409096 3.633879
## [2,] 4.229106 3.836692 5.102426 4.961422 4.400693 3.438423 3.990446 3.566777
## [3,] 3.356085 2.982889 4.119626 3.578158 4.034013 4.130848 3.235263 4.159202
## [4,] 3.239968 3.823739 3.322169 4.420040 3.106976 3.414856 3.829998 2.867578
## [5,] 3.667308 4.606330 4.171149 4.224345 4.233954 4.261438 3.309516 4.215014
## [6,] 4.961495 4.173720 4.493158 4.773990 3.962522 4.558891 4.885706 3.204241
## [7,] 3.986448 4.107196 3.728551 3.924431 4.129880 3.892413 3.908187 4.241688
## [8,] 3.872852 3.988996 4.332367 4.222874 3.751557 3.725507 4.335717 3.649585
## [9,] 4.260885 3.756859 3.915227 4.903622 3.154237 4.190083 3.488394 4.148209
## [10,] 3.468488 3.216671 4.013421 3.576007 4.535524 3.831442 3.802662 4.099167
## [11,] 4.206145 4.467231 4.243924 4.061135 3.870461 4.646454 3.184698 3.951411
## [12,] 4.258194 4.657561 4.165253 4.437789 3.826748 5.248871 3.832684 3.340978
## [,57] [,58] [,59] [,60] [,61] [,62] [,63] [,64]
## [1,] 4.219044 3.337389 4.662086 4.477374 5.087193 3.950992 4.742145 3.601935
## [2,] 3.363058 3.870399 3.975779 3.418803 3.803537 3.731686 3.906127 4.502223
## [3,] 3.921803 4.083058 3.160646 5.149696 4.827098 3.597827 4.132701 3.794200
## [4,] 4.924703 4.497521 3.882780 3.665598 3.734556 3.523879 4.171170 4.856501
## [5,] 4.547341 4.376962 4.083313 3.480138 4.127473 4.738917 3.969565 4.412266
## [6,] 3.622148 3.893836 4.073178 4.072814 4.270628 3.288025 3.538632 4.408430
## [7,] 3.654753 3.563185 3.804168 5.851449 3.533703 3.785848 5.201186 4.583561
## [8,] 4.729750 3.390787 3.780385 4.798593 3.730393 3.185300 4.218917 4.574586
## [9,] 3.103266 3.369001 4.355174 4.067438 4.004236 4.757636 3.047474 4.663456
## [10,] 3.958422 4.372141 3.848594 4.591008 4.335885 3.717435 3.452357 3.639926
## [11,] 3.901467 4.300712 3.709840 4.310560 4.812709 4.158449 3.550073 4.319738
## [12,] 3.940315 3.313248 4.487128 4.367373 3.824127 4.206614 4.197817 3.620968
## [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72]
## [1,] 2.416938 3.724307 3.583643 4.353590 3.369058 3.795824 3.486684 3.966329
## [2,] 3.090257 3.596164 4.151700 4.084851 5.307788 4.170633 4.358752 4.670292
## [3,] 4.396107 3.830082 4.939440 3.387937 4.302925 3.420667 3.642200 3.525061
## [4,] 3.939507 4.229552 3.816067 2.930327 4.118707 4.802324 3.875054 3.844175
## [5,] 4.597386 2.862752 3.353656 4.214453 4.629896 4.088413 4.484097 3.933512
## [6,] 4.412089 3.592237 4.092031 3.261550 4.078085 4.452123 5.024189 4.360034
## [7,] 4.476356 4.182393 4.302498 3.285890 4.072320 3.677908 3.725388 3.942323
## [8,] 3.674426 3.977568 4.930262 4.710830 2.932054 4.204196 4.062548 4.262442
## [9,] 3.964075 4.366059 4.212835 3.789953 4.690001 3.719042 3.881918 4.307955
## [10,] 4.526526 4.104391 4.599498 3.817383 3.177142 3.661852 3.978386 4.449618
## [11,] 3.435578 3.815031 3.993271 3.267937 3.824687 4.072215 4.420509 4.231912
## [12,] 4.020422 4.459086 4.402890 4.004837 3.850940 4.312436 4.467743 4.443322
## [,73] [,74] [,75] [,76] [,77] [,78] [,79] [,80]
## [1,] 3.621089 3.624595 3.402282 3.977050 4.405100 3.719533 3.575649 3.643561
## [2,] 3.854352 3.872766 4.300977 4.349904 4.922284 4.688765 3.884412 3.677187
## [3,] 4.199731 3.248905 4.806662 4.335465 3.170085 3.630456 4.102798 4.328492
## [4,] 3.779342 3.918345 5.052226 4.373859 3.840220 4.215669 3.235165 4.166412
## [5,] 5.034980 4.294281 3.544271 3.367207 3.382914 4.462980 4.943983 4.412250
## [6,] 4.252906 4.184589 3.994573 4.728866 3.465358 3.507475 3.662955 2.760908
## [7,] 3.875998 3.909597 4.501612 4.042840 4.127344 3.596008 3.639540 3.971745
## [8,] 3.526526 4.383659 3.166116 4.293804 3.517778 3.839181 3.312618 3.861135
## [9,] 3.819420 4.116218 4.463354 3.826854 3.627565 4.123171 3.663026 4.520982
## [10,] 3.617858 3.847304 4.158307 3.602366 4.656782 4.094426 4.206749 3.250462
## [11,] 3.793970 4.680214 4.181537 3.499451 4.054646 3.736624 5.373035 3.946777
## [12,] 4.144180 3.610297 3.575507 3.853420 4.078163 4.632805 3.523322 4.301783
## [,81] [,82] [,83] [,84] [,85] [,86] [,87] [,88]
## [1,] 3.399587 4.440692 3.343859 4.843567 3.983574 3.712281 2.964138 3.803249
## [2,] 4.173808 3.800750 3.714190 3.815343 3.185782 3.956168 4.570786 3.479100
## [3,] 4.419876 3.868512 4.592011 4.393542 3.718665 4.155835 3.750550 4.631990
## [4,] 3.539367 4.534290 3.156899 3.537423 4.376613 4.122194 4.286050 4.953106
## [5,] 4.033380 3.681079 3.306198 4.002325 3.574132 3.770983 4.626052 3.680271
## [6,] 3.935276 3.258074 3.642800 3.385625 3.542436 4.662965 3.241597 4.976206
## [7,] 4.219014 3.912069 5.238433 3.929701 3.777577 3.710239 4.128420 4.147770
## [8,] 3.525987 4.513659 3.696596 3.896337 4.117248 3.587962 4.607959 3.571752
## [9,] 4.195526 3.139100 3.870751 3.539235 3.275518 4.542810 3.685117 4.432102
## [10,] 3.946118 3.588565 3.372645 4.180237 3.703051 4.707954 4.324387 4.092541
## [11,] 4.131180 3.558261 4.198832 4.833301 3.624277 4.445441 4.139429 4.149169
## [12,] 4.102473 4.643521 3.920131 4.724023 4.093568 4.199653 3.819862 4.320970
## [,89] [,90] [,91] [,92] [,93] [,94] [,95] [,96]
## [1,] 3.808598 4.405629 3.584431 3.531188 3.533061 4.170129 3.601469 4.685678
## [2,] 3.051376 4.197426 4.478226 3.863841 4.124560 4.414599 3.491032 4.394245
## [3,] 4.033078 4.502245 3.901089 4.524026 3.467093 3.906028 4.333381 4.357740
## [4,] 3.654067 3.075605 3.727527 3.764928 4.192081 3.484879 3.553403 3.724368
## [5,] 4.899020 3.507922 3.836536 3.967532 3.457101 3.134951 4.296619 4.497254
## [6,] 4.196714 3.890726 4.303613 4.348513 4.110648 4.225797 3.975887 4.026341
## [7,] 3.783742 3.599539 4.803362 4.113433 2.579114 3.434906 4.949874 4.889088
## [8,] 3.524020 4.200541 4.180466 3.519456 3.621266 3.393450 3.621376 3.423575
## [9,] 3.891875 4.447139 3.870106 4.164289 3.637104 3.301224 3.687153 4.701459
## [10,] 3.478604 3.745041 3.942100 4.071718 3.752536 5.202353 4.706792 4.265205
## [11,] 4.263472 4.444192 4.652296 4.823261 4.058901 3.837350 4.044614 4.382819
## [12,] 3.945066 3.950811 4.636235 3.629074 3.195094 4.631844 4.846532 4.215688
## [,97] [,98] [,99] [,100]
## [1,] 4.367873 3.818106 4.306664 4.129440
## [2,] 3.710672 3.764697 3.507370 4.159417
## [3,] 3.571331 4.251800 4.478088 3.256640
## [4,] 3.747195 4.810987 4.297790 3.757757
## [5,] 4.493099 4.489701 3.516138 4.358661
## [6,] 4.221515 3.576542 4.663458 3.843927
## [7,] 3.556852 3.771047 4.192955 4.104886
## [8,] 4.338862 3.395047 4.289707 3.268729
## [9,] 3.877157 4.041465 4.692336 2.457133
## [10,] 3.794496 4.416906 3.915628 4.308270
## [11,] 4.199506 4.969434 2.861615 4.574665
## [12,] 3.888944 4.141308 4.580134 4.410257
medias <- colMeans(BIOM); medias
## [1] 3.959021 4.102240 4.245160 3.907424 4.004220 4.354478 3.885046 4.003555
## [9] 3.913537 4.000278 4.022795 4.022869 3.703933 3.946211 3.882827 3.993194
## [17] 4.030557 4.042965 3.940365 4.009682 4.075811 3.949231 3.673003 3.911237
## [25] 3.810993 4.426878 3.951797 3.990949 3.783955 3.852524 3.977213 4.110408
## [33] 3.948082 3.840346 3.894652 3.881319 3.965457 3.962246 4.081354 3.817969
## [41] 4.008334 4.082217 3.838654 3.861027 4.075884 4.018439 3.921245 4.111390
## [49] 4.061037 3.952523 4.143863 4.211746 3.870868 4.023412 3.851031 3.756477
## [57] 3.990506 3.864020 3.985256 4.354237 4.174295 3.886884 4.010680 4.248149
## [65] 3.912472 3.894968 4.198149 3.759128 4.029467 4.031469 4.117289 4.161415
## [73] 3.960029 3.974231 4.095619 4.020924 3.937353 4.020591 3.926938 3.903474
## [81] 3.968466 3.911548 3.837779 4.090055 3.747703 4.131207 4.012029 4.186519
## [89] 3.877469 3.997235 4.159666 4.026772 3.644046 3.928126 4.092344 4.296955
## [97] 3.980625 4.120587 4.108490 3.885815
EEbueno <- sd(medias); EEbueno # Desviación de los promedios
## [1] 0.1423119
sd(BIOM)
## [1] 0.5131402
sd(BIOM)/sqrt(100) # n es 10, porque es el número de promedios
## [1] 0.05131402
seq(1:10) # Crear una secuencia
## [1] 1 2 3 4 5 6 7 8 9 10
x <- c(1:10)
paste0("Z", x)
## [1] "Z1" "Z2" "Z3" "Z4" "Z5" "Z6" "Z7" "Z8" "Z9" "Z10"
Generador de niveles. Factores.
Ej: Rendimiento. Factor: cultivar
g1 L1- L2
g2 L1 - L2
g3 L1 - L2
3 niveles - 3 tratamientos
Si se tienen dos localidades, se está generando otro factor con 2 niveles. Combinaciones forman los tratamientos. Para un total de 6 tratamientos. Tratamientos: combinaciones de los niveles de todos los factores.
Supongamos que tenemos 5 tratamientos con 3 repeticiones.
# Ejemplo: T1 T1 T1 T2 T2 T2 T3 T3 T3 T4 T4 T4 T5 T5 T5
trt <- gl(n=5, k=3, 15, labels = paste0("T", 1:5)); trt # Labels: etiquetas
## [1] T1 T1 T1 T2 T2 T2 T3 T3 T3 T4 T4 T4 T5 T5 T5
## Levels: T1 T2 T3 T4 T5
# Crear un dataframe para la biomasa. Más útil para la visualización de los datos, que para crear las variables
dfb <- data.frame(biom, hilera); dfb
## biom hilera
## 1 4.188 h1
## 2 4.151 h1
## 3 3.451 h1
## 4 3.435 h1
## 5 2.602 h1
## 6 4.360 h1
## 7 4.470 h1
## 8 3.885 h1
## 9 4.880 h1
## 10 4.059 h1
## 11 3.573 h1
## 12 4.455 h1
## 13 4.598 h2
## 14 3.814 h2
## 15 3.938 h2
## 16 4.900 h2
## 17 4.852 h2
## 18 2.481 h2
## 19 2.856 h2
## 20 4.029 h2
## 21 5.087 h2
## 22 4.549 h2
## 23 4.159 h2
## 24 3.963 h2
## 25 4.417 h3
## 26 4.099 h3
## 27 4.649 h3
## 28 4.468 h3
## 29 3.926 h3
## 30 4.055 h3
## 31 3.594 h3
## 32 3.628 h3
## 33 4.548 h3
## 34 5.218 h3
## 35 4.194 h3
## 36 4.145 h3
## 37 3.857 h4
## 38 4.038 h4
## 39 3.720 h4
## 40 4.224 h4
## 41 4.454 h4
## 42 3.747 h4
## 43 3.849 h4
## 44 3.637 h4
## 45 3.410 h4
## 46 4.127 h4
## 47 3.815 h4
## 48 4.011 h4
## 49 4.330 h5
## 50 4.244 h5
## 51 3.906 h5
## 52 4.301 h5
## 53 3.663 h5
## 54 4.238 h5
## 55 4.059 h5
## 56 4.061 h5
## 57 3.907 h5
## 58 3.336 h5
## 59 3.717 h5
## 60 4.289 h5
## 61 4.955 h6
## 62 4.125 h6
## 63 3.201 h6
## 64 5.601 h6
## 65 4.478 h6
## 66 4.184 h6
## 67 4.461 h6
## 68 3.897 h6
## 69 4.046 h6
## 70 4.084 h6
## 71 4.398 h6
## 72 4.823 h6
## 73 3.142 h7
## 74 3.841 h7
## 75 3.548 h7
## 76 3.648 h7
## 77 3.111 h7
## 78 3.639 h7
## 79 4.023 h7
## 80 4.122 h7
## 81 4.314 h7
## 82 3.988 h7
## 83 5.157 h7
## 84 4.089 h7
## 85 3.488 h8
## 86 5.137 h8
## 87 3.055 h8
## 88 4.547 h8
## 89 4.923 h8
## 90 4.261 h8
## 91 3.234 h8
## 92 3.030 h8
## 93 4.243 h8
## 94 4.623 h8
## 95 3.891 h8
## 96 3.610 h8
## 97 4.174 h9
## 98 4.341 h9
## 99 3.734 h9
## 100 3.661 h9
## 101 3.136 h9
## 102 3.504 h9
## 103 3.707 h9
## 104 4.192 h9
## 105 4.373 h9
## 106 3.536 h9
## 107 3.831 h9
## 108 4.773 h9
## 109 4.133 h10
## 110 4.150 h10
## 111 3.839 h10
## 112 4.718 h10
## 113 4.503 h10
## 114 3.140 h10
## 115 4.149 h10
## 116 3.588 h10
## 117 3.400 h10
## 118 3.362 h10
## 119 3.938 h10
## 120 5.083 h10
head(dfb) # Datos de la cabeza, y la función tail() para ver la cola de los datos
## biom hilera
## 1 4.188 h1
## 2 4.151 h1
## 3 3.451 h1
## 4 3.435 h1
## 5 2.602 h1
## 6 4.360 h1
tail(dfb)
## biom hilera
## 115 4.149 h10
## 116 3.588 h10
## 117 3.400 h10
## 118 3.362 h10
## 119 3.938 h10
## 120 5.083 h10