-
Notifications
You must be signed in to change notification settings - Fork 0
/
distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html
592 lines (545 loc) · 74.7 KB
/
distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title> 3 Distribution of Tortoises and Freshwater Turtles of the Colombian Caribbean | Introduccion a los Metodos de Análisis Multivariados</title>
<meta name="description" content=" 3 Distribution of Tortoises and Freshwater Turtles of the Colombian Caribbean | Introduccion a los Metodos de Análisis Multivariados" />
<meta name="generator" content="bookdown 0.34 and GitBook 2.6.7" />
<meta property="og:title" content=" 3 Distribution of Tortoises and Freshwater Turtles of the Colombian Caribbean | Introduccion a los Metodos de Análisis Multivariados" />
<meta property="og:type" content="book" />
<meta name="github-repo" content="https://github.com/Joanurp" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content=" 3 Distribution of Tortoises and Freshwater Turtles of the Colombian Caribbean | Introduccion a los Metodos de Análisis Multivariados" />
<meta name="author" content="Jose Angel Urquijo Parra" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="prev" href="inferencia-a-partir-de-la-matriz-de-covarianza.html"/>
<link rel="next" href="mediciones-morfométricas-de-104-zarigueyas-capturadas.html"/>
<script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.4.6/dist/fuse.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections-hash.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.1.0/anchor-sections.js"></script>
<style type="text/css">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<style type="text/css">
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li><a href="./">Introduccion a los Metodos de Análisis Multivariados</a></li>
<li class="divider"></li>
<li class="chapter" data-level="1" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i><b>1</b> Estadístico T2 Hoteling</a>
<ul>
<li class="chapter" data-level="1.1" data-path="index.html"><a href="index.html#estadístico-t2-hoteling-para-muestras-independientes"><i class="fa fa-check"></i><b>1.1</b> Estadístico T2 Hoteling para muestras independientes</a></li>
<li class="chapter" data-level="1.2" data-path="index.html"><a href="index.html#estadístico-t2-hoteling-para-muestras-relacionadas"><i class="fa fa-check"></i><b>1.2</b> Estadístico T2 Hoteling para muestras relacionadas</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="inferencia-a-partir-de-la-matriz-de-covarianza.html"><a href="inferencia-a-partir-de-la-matriz-de-covarianza.html"><i class="fa fa-check"></i><b>2</b> Inferencia a partir de la matriz de covarianza</a>
<ul>
<li class="chapter" data-level="2.1" data-path="inferencia-a-partir-de-la-matriz-de-covarianza.html"><a href="inferencia-a-partir-de-la-matriz-de-covarianza.html#contraste-de-igualdad-de-matrices-de-covarianzas-en-dos-poblaciones-normales-multivariantes"><i class="fa fa-check"></i><b>2.1</b> Contraste de igualdad de matrices de covarianzas en dos poblaciones normales multivariantes</a></li>
<li class="chapter" data-level="2.2" data-path="inferencia-a-partir-de-la-matriz-de-covarianza.html"><a href="inferencia-a-partir-de-la-matriz-de-covarianza.html#contraste-de-igualdad-de-matrices-de-covarianzas-para-varias-poblaciones"><i class="fa fa-check"></i><b>2.2</b> Contraste de igualdad de matrices de covarianzas para varias poblaciones</a></li>
</ul></li>
<li class="chapter" data-level="3" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><i class="fa fa-check"></i><b>3</b> Distribution of Tortoises and Freshwater Turtles of the Colombian Caribbean</a>
<ul>
<li class="chapter" data-level="3.1" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#análisis-exploratorio.-distribution-of-tortoises-and-freshwater-turtles"><i class="fa fa-check"></i><b>3.1</b> Análisis exploratorio. Distribution of Tortoises and Freshwater Turtles</a>
<ul>
<li class="chapter" data-level="3.1.1" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#dispersograma-de-los-datos."><i class="fa fa-check"></i><b>3.1.1</b> Dispersograma de los datos.</a></li>
<li class="chapter" data-level="3.1.2" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#boxplot-adecuado.-comente-los-resultados."><i class="fa fa-check"></i><b>3.1.2</b> Boxplot adecuado. Comente los resultados.</a></li>
<li class="chapter" data-level="3.1.3" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#distancia-de-mahalanobis-entre-los-centroides-de-los-dos-sexos."><i class="fa fa-check"></i><b>3.1.3</b> Distancia de Mahalanobis entre los centroides de los dos sexos.</a></li>
<li class="chapter" data-level="3.1.4" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#test-de-kolmogorov-smirnov-y-shapiro-wilk."><i class="fa fa-check"></i><b>3.1.4</b> Test de Kolmogorov-Smirnov y Shapiro-Wilk.</a></li>
<li class="chapter" data-level="3.1.5" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#gráfico-qqplot-multinormalidad-de-los-datos."><i class="fa fa-check"></i><b>3.1.5</b> Gráfico QQplot multinormalidad de los datos.</a></li>
<li class="chapter" data-level="3.1.6" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#test-de-shapiro-wilk-multivariado-y-mardia"><i class="fa fa-check"></i><b>3.1.6</b> Test de Shapiro-Wilk multivariado y Mardia</a></li>
<li class="chapter" data-level="3.1.7" data-path="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#diferencias-estadísticas-fuertes-entre-dichos-géneros."><i class="fa fa-check"></i><b>3.1.7</b> Diferencias estadísticas fuertes entre dichos géneros.</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="4" data-path="mediciones-morfométricas-de-104-zarigueyas-capturadas.html"><a href="mediciones-morfométricas-de-104-zarigueyas-capturadas.html"><i class="fa fa-check"></i><b>4</b> Mediciones Morfométricas de 104 zarigueyas capturadas</a>
<ul>
<li class="chapter" data-level="4.1" data-path="mediciones-morfométricas-de-104-zarigueyas-capturadas.html"><a href="mediciones-morfométricas-de-104-zarigueyas-capturadas.html#visualización-de-los-componentes"><i class="fa fa-check"></i><b>4.1</b> Visualización de los componentes</a></li>
<li class="chapter" data-level="4.2" data-path="mediciones-morfométricas-de-104-zarigueyas-capturadas.html"><a href="mediciones-morfométricas-de-104-zarigueyas-capturadas.html#modelo-final"><i class="fa fa-check"></i><b>4.2</b> Modelo Final</a>
<ul>
<li class="chapter" data-level="4.2.1" data-path="mediciones-morfométricas-de-104-zarigueyas-capturadas.html"><a href="mediciones-morfométricas-de-104-zarigueyas-capturadas.html#variables-que-más-contribuyen-al-modelo"><i class="fa fa-check"></i><b>4.2.1</b> Variables que más contribuyen al modelo</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="5" data-path="información-financiera-de-810-sujetos.html"><a href="información-financiera-de-810-sujetos.html"><i class="fa fa-check"></i><b>5</b> Información Financiera de 810 sujetos</a></li>
<li class="chapter" data-level="6" data-path="golpes-militares-y-política-en-áfrica-subsahariana.html"><a href="golpes-militares-y-política-en-áfrica-subsahariana.html"><i class="fa fa-check"></i><b>6</b> Golpes militares y política en África subsahariana</a>
<ul>
<li class="chapter" data-level="6.0.1" data-path="golpes-militares-y-política-en-áfrica-subsahariana.html"><a href="golpes-militares-y-política-en-áfrica-subsahariana.html#clúster-análisis."><i class="fa fa-check"></i><b>6.0.1</b> Clúster análisis.</a></li>
<li class="chapter" data-level="6.1" data-path="golpes-militares-y-política-en-áfrica-subsahariana.html"><a href="golpes-militares-y-política-en-áfrica-subsahariana.html#bibliografía"><i class="fa fa-check"></i><b>6.1</b> Bibliografía</a></li>
</ul></li>
<li class="divider"></li>
<li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i><a href="./">Introduccion a los Metodos de Análisis Multivariados</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<div id="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean" class="section level1 hasAnchor" number="3">
<h1><span class="header-section-number"> 3</span> Distribution of Tortoises and Freshwater Turtles of the Colombian Caribbean<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<p></p>
<div id="análisis-exploratorio.-distribution-of-tortoises-and-freshwater-turtles" class="section level2 hasAnchor" number="3.1">
<h2><span class="header-section-number">3.1</span> Análisis exploratorio. Distribution of Tortoises and Freshwater Turtles<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#análisis-exploratorio.-distribution-of-tortoises-and-freshwater-turtles" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb31-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-1" tabindex="-1"></a><span class="co"># Cargamos los datos</span></span>
<span id="cb31-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-2" tabindex="-1"></a>tortugas <span class="ot"><-</span> <span class="fu">data.frame</span>(</span>
<span id="cb31-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-3" tabindex="-1"></a> <span class="at">length_Hem =</span> <span class="fu">c</span>(<span class="dv">98</span>, <span class="dv">103</span>, <span class="dv">103</span>, <span class="dv">105</span>, <span class="dv">109</span>, <span class="dv">123</span>, <span class="dv">123</span>, <span class="dv">133</span>, <span class="dv">133</span>, <span class="dv">133</span>, <span class="dv">134</span>, <span class="dv">136</span>, <span class="dv">138</span>,</span>
<span id="cb31-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-4" tabindex="-1"></a> <span class="dv">138</span>, <span class="dv">141</span>, <span class="dv">147</span>, <span class="dv">149</span>, <span class="dv">153</span>, <span class="dv">155</span>, <span class="dv">155</span>, <span class="dv">158</span>, <span class="dv">159</span>, <span class="dv">162</span>, <span class="dv">177</span>),</span>
<span id="cb31-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-5" tabindex="-1"></a> </span>
<span id="cb31-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-6" tabindex="-1"></a> <span class="at">length_Mach =</span> <span class="fu">c</span>(<span class="dv">93</span>, <span class="dv">94</span>, <span class="dv">96</span>, <span class="dv">101</span>, <span class="dv">102</span>, <span class="dv">103</span>, <span class="dv">110</span>, <span class="dv">106</span>, <span class="dv">107</span>, <span class="dv">112</span>, <span class="dv">113</span>, <span class="dv">114</span>, <span class="dv">116</span>, <span class="dv">117</span>,</span>
<span id="cb31-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-7" tabindex="-1"></a> <span class="dv">117</span>, <span class="dv">119</span>, <span class="dv">120</span>, <span class="dv">120</span>, <span class="dv">121</span>, <span class="dv">125</span>, <span class="dv">127</span>, <span class="dv">130</span>, <span class="dv">131</span>, <span class="dv">135</span>),</span>
<span id="cb31-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-8" tabindex="-1"></a> </span>
<span id="cb31-9"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-9" tabindex="-1"></a> <span class="at">width_Hem =</span> <span class="fu">c</span>(<span class="dv">81</span>, <span class="dv">84</span>, <span class="dv">86</span>, <span class="dv">86</span>, <span class="dv">88</span>, <span class="dv">92</span>, <span class="dv">95</span>, <span class="dv">99</span>, <span class="dv">102</span>, <span class="dv">102</span>, <span class="dv">100</span>, <span class="dv">102</span>, <span class="dv">98</span>, <span class="dv">99</span>, <span class="dv">105</span>,</span>
<span id="cb31-10"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-10" tabindex="-1"></a> <span class="dv">108</span>, <span class="dv">107</span>, <span class="dv">107</span>, <span class="dv">115</span>, <span class="dv">120</span>, <span class="dv">115</span>, <span class="dv">118</span>, <span class="dv">124</span>, <span class="dv">132</span>),</span>
<span id="cb31-11"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-11" tabindex="-1"></a> </span>
<span id="cb31-12"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-12" tabindex="-1"></a> <span class="at">width_Mach =</span> <span class="fu">c</span>(<span class="dv">74</span>, <span class="dv">78</span>, <span class="dv">80</span>, <span class="dv">84</span>, <span class="dv">85</span>, <span class="dv">81</span>, <span class="dv">83</span>, <span class="dv">83</span>, <span class="dv">88</span>, <span class="dv">89</span>, <span class="dv">88</span>, <span class="dv">86</span>, <span class="dv">90</span>, <span class="dv">90</span>, <span class="dv">91</span>, <span class="dv">93</span>,</span>
<span id="cb31-13"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-13" tabindex="-1"></a> <span class="dv">89</span>, <span class="dv">93</span>, <span class="dv">95</span>, <span class="dv">93</span>, <span class="dv">96</span>, <span class="dv">95</span>, <span class="dv">95</span>, <span class="dv">106</span>),</span>
<span id="cb31-14"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-14" tabindex="-1"></a> </span>
<span id="cb31-15"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-15" tabindex="-1"></a> <span class="at">height_Hem =</span> <span class="fu">c</span>(<span class="dv">38</span>, <span class="dv">38</span>, <span class="dv">42</span>, <span class="dv">42</span>, <span class="dv">44</span>, <span class="dv">50</span>, <span class="dv">46</span>, <span class="dv">51</span>, <span class="dv">51</span>, <span class="dv">51</span>, <span class="dv">48</span>, <span class="dv">49</span>, <span class="dv">51</span>, <span class="dv">51</span>, <span class="dv">53</span>, <span class="dv">57</span>,</span>
<span id="cb31-16"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-16" tabindex="-1"></a> <span class="dv">55</span>, <span class="dv">56</span>, <span class="dv">63</span>, <span class="dv">68</span>, <span class="dv">62</span>, <span class="dv">63</span>, <span class="dv">61</span>, <span class="dv">67</span>),</span>
<span id="cb31-17"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-17" tabindex="-1"></a> </span>
<span id="cb31-18"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-18" tabindex="-1"></a> <span class="at">height_Mach =</span> <span class="fu">c</span>(<span class="dv">37</span>, <span class="dv">35</span>, <span class="dv">35</span>, <span class="dv">39</span>, <span class="dv">38</span>, <span class="dv">37</span>, <span class="dv">39</span>, <span class="dv">39</span>, <span class="dv">38</span>, <span class="dv">40</span>, <span class="dv">40</span>, <span class="dv">40</span>, <span class="dv">43</span>, <span class="dv">41</span>, <span class="dv">41</span>, <span class="dv">41</span>,</span>
<span id="cb31-19"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-19" tabindex="-1"></a> <span class="dv">40</span>, <span class="dv">44</span>, <span class="dv">44</span>, <span class="dv">45</span>, <span class="dv">45</span>, <span class="dv">45</span>, <span class="dv">46</span>, <span class="dv">47</span>)</span>
<span id="cb31-20"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-20" tabindex="-1"></a>)</span>
<span id="cb31-21"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-21" tabindex="-1"></a></span>
<span id="cb31-22"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-22" tabindex="-1"></a><span class="co"># Resumen de los datos</span></span>
<span id="cb31-23"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb31-23" tabindex="-1"></a><span class="fu">descr</span>(tortugas)</span></code></pre></div>
<pre><code>Descriptive Statistics
tortugas
N: 24
height_Hem height_Mach length_Hem length_Mach width_Hem width_Mach
----------------- ------------ ------------- ------------ ------------- ----------- ------------
Mean 52.38 40.79 136.04 113.71 102.71 88.54
Std.Dev 8.54 3.41 21.25 11.75 13.26 6.95
Min 38.00 35.00 98.00 93.00 81.00 74.00
Q1 47.00 38.50 123.00 104.50 93.50 83.50
Median 51.00 40.00 137.00 115.00 102.00 89.00
Q3 59.00 44.00 154.00 120.50 111.50 93.00
Max 68.00 47.00 177.00 135.00 132.00 106.00
MAD 8.15 3.71 22.24 12.60 12.60 6.67
IQR 10.50 5.25 30.50 15.00 15.50 9.25
CV 0.16 0.08 0.16 0.10 0.13 0.08
Skewness 0.13 0.13 -0.22 -0.10 0.29 0.13
SE.Skewness 0.47 0.47 0.47 0.47 0.47 0.47
Kurtosis -0.95 -1.09 -0.92 -1.00 -0.71 0.05
N.Valid 24.00 24.00 24.00 24.00 24.00 24.00
Pct.Valid 100.00 100.00 100.00 100.00 100.00 100.00</code></pre>
<p>Al considerar los diversos resultados, podemos hacer comparativas entre las tres medidas presentadas:</p>
<ul>
<li><p><strong>Largo:</strong> podemos apreciar que al tomar la medida del largo de las tortugas, las hembras son la que en promedio presentan mayor distancia, sin embargo, tambien son las que mayor rango tienen, y presentan una desviación de 21.25, 9.5 unidades mayor que la desviación de los machos, donde se aprecia que el rango de los machos no es tan grande como el de las hembras.</p></li>
<li><p><strong>Alto:</strong> Se observa que al igual que en el caso anterior, las hembras poseen en promedio mayores distancias registradas que los hombres, algo que también se evidencia en la deviación estándar y también presentan un mayor rango que en el caso de los hombres.</p></li>
<li><p><strong>Ancho:</strong> Las apreciaciones anteriores, obtienen un comportamiento similar en este caso, pues son las mujeres las que en promedio mayor distancia poseen, mayor desviación y rango tienen en comparación con los machos observados.</p></li>
</ul>
<p>Estas observaciones preliminarmente sugieren que las tortugas hembras se caracterizan por ser más grandes que los machos.</p>
<p>Por otro lado al observar la asimetría se puede apreciar que de las 3 variables (observándolo de manera general) la medida de la longitud es negativa, siendo cercana a cero, indicando una leve concentración de los ladtos al lado derecho de la mediana, sin embargo esta cercania al cero, también da indicios de una aproximación a una simetría por parte de la variable. De manera similar ocurre con las otras dos variables tanto para machos como hembras, solo que los datos tienden a concentrarse levemente al lado izquierdo de la mediana, pero con valores lo suficientemente cercanos a cero para considerar que también se aproximan a tener simetría en su distribución.</p>
<p>Ahora bien, sobre la curtosis de los datos se apreciar que esta es negativa en su mayoría, un hecho que solo difiere en la variable de anchura en el macho; sin embargo, se puede apreciar que sus valores son bastantes próximos a cero, lo que sugiere desde un punto preliminar que las variables se aproximan a una distribución normal.</p>
<div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb33-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-1" tabindex="-1"></a><span class="co"># Calcular matriz de correlación</span></span>
<span id="cb33-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-2" tabindex="-1"></a>correlation_matrix <span class="ot"><-</span> <span class="fu">cor</span>(tortugas)</span>
<span id="cb33-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-3" tabindex="-1"></a></span>
<span id="cb33-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-4" tabindex="-1"></a><span class="fu">corrplot</span>(correlation_matrix, <span class="at">method =</span> <span class="st">"circle"</span>, <span class="at">type =</span> <span class="st">"upper"</span>, </span>
<span id="cb33-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-5" tabindex="-1"></a> <span class="at">tl.col =</span> <span class="st">"black"</span>, <span class="at">tl.srt =</span> <span class="dv">45</span>, <span class="at">diag =</span> <span class="cn">FALSE</span>,</span>
<span id="cb33-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-6" tabindex="-1"></a> <span class="at">addCoef.col =</span> <span class="st">"black"</span>, <span class="at">number.cex =</span> <span class="fl">0.7</span>,</span>
<span id="cb33-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-7" tabindex="-1"></a> <span class="at">tl.cex =</span> <span class="fl">0.8</span>, <span class="at">cl.cex =</span> <span class="fl">0.8</span>, <span class="at">mar =</span> <span class="fu">c</span>(<span class="dv">0</span>,<span class="dv">0</span>,<span class="dv">2</span>,<span class="dv">0</span>),</span>
<span id="cb33-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb33-8" tabindex="-1"></a> <span class="at">main =</span> <span class="st">"Matriz de Correlación"</span>)</span></code></pre></div>
<p><img src="Bookdown_files/figure-html/unnamed-chunk-10-1.png" width="672" /></p>
<div id="dispersograma-de-los-datos." class="section level3 hasAnchor" number="3.1.1">
<h3><span class="header-section-number">3.1.1</span> Dispersograma de los datos.<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#dispersograma-de-los-datos." class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>Realice un dispersograma de los datos. En el dispersograma use puntos de acuerdo con el color de la especie por sexo. ¿Considera que el color en realidad diferencia las especies? Justifique su respuesta.</p>
<div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb34-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-1" tabindex="-1"></a><span class="fu">attach</span>(tortugas)</span>
<span id="cb34-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-2" tabindex="-1"></a>s3d_hembra <span class="ot"><-</span> <span class="fu">scatterplot3d</span>(<span class="at">x =</span> length_Hem, <span class="at">y =</span> width_Hem, <span class="at">z =</span> height_Hem,</span>
<span id="cb34-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-3" tabindex="-1"></a> <span class="at">color =</span> <span class="st">"blue"</span>, <span class="at">pch =</span> <span class="dv">19</span>, <span class="at">type =</span> <span class="st">"p"</span>, <span class="at">main =</span> <span class="st">"Tortugas"</span>,</span>
<span id="cb34-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-4" tabindex="-1"></a> <span class="at">xlab =</span> <span class="st">"Longitud"</span>, <span class="at">ylab =</span> <span class="st">"Ancho"</span>, <span class="at">zlab =</span> <span class="st">"Altura"</span>)</span>
<span id="cb34-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-5" tabindex="-1"></a>s3d_hembra<span class="sc">$</span><span class="fu">points3d</span>(<span class="at">x =</span> length_Mach, <span class="at">y =</span> width_Mach, <span class="at">z =</span> height_Mach,</span>
<span id="cb34-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-6" tabindex="-1"></a> <span class="at">col =</span> <span class="st">"red"</span>, <span class="at">pch =</span> <span class="dv">19</span>)</span>
<span id="cb34-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-7" tabindex="-1"></a><span class="fu">legend</span>(<span class="st">"topright"</span>, <span class="at">legend =</span> <span class="fu">c</span>(<span class="st">"Hembra"</span>, <span class="st">"Macho"</span>), <span class="at">col =</span> <span class="fu">c</span>(<span class="st">"blue"</span>, <span class="st">"red"</span>), <span class="at">pch =</span> <span class="dv">19</span>)</span>
<span id="cb34-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb34-8" tabindex="-1"></a><span class="fu">title</span>(<span class="at">main =</span> <span class="st">"Tortugas"</span>)</span></code></pre></div>
<p><img src="Bookdown_files/figure-html/unnamed-chunk-11-1.png" width="672" /></p>
<div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb35-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb35-1" tabindex="-1"></a><span class="fu">detach</span>(tortugas)</span></code></pre></div>
</div>
<div id="boxplot-adecuado.-comente-los-resultados." class="section level3 hasAnchor" number="3.1.2">
<h3><span class="header-section-number">3.1.2</span> Boxplot adecuado. Comente los resultados.<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#boxplot-adecuado.-comente-los-resultados." class="anchor-section" aria-label="Anchor link to header"></a></h3>
<div class="sourceCode" id="cb36"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb36-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-1" tabindex="-1"></a><span class="co"># Convertir el marco de datos a un formato largo (tidy data)</span></span>
<span id="cb36-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-2" tabindex="-1"></a>tortugas_long <span class="ot"><-</span> <span class="fu">pivot_longer</span>(tortugas, <span class="at">cols =</span> <span class="fu">everything</span>(),</span>
<span id="cb36-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-3" tabindex="-1"></a> <span class="at">names_to =</span> <span class="st">"variable"</span>, <span class="at">values_to =</span> <span class="st">"valor"</span>)</span>
<span id="cb36-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-4" tabindex="-1"></a><span class="fu">ggplot</span>(tortugas_long, <span class="fu">aes</span>(<span class="at">x =</span> variable, <span class="at">y =</span> valor, <span class="at">fill =</span> variable)) <span class="sc">+</span></span>
<span id="cb36-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-5" tabindex="-1"></a> <span class="fu">geom_boxplot</span>() <span class="sc">+</span></span>
<span id="cb36-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-6" tabindex="-1"></a> <span class="fu">facet_wrap</span>(<span class="sc">~</span> variable, <span class="at">scales =</span> <span class="st">"free"</span>) <span class="sc">+</span></span>
<span id="cb36-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-7" tabindex="-1"></a> <span class="fu">xlab</span>(<span class="st">"Variable"</span>) <span class="sc">+</span></span>
<span id="cb36-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-8" tabindex="-1"></a> <span class="fu">ylab</span>(<span class="st">"Valor"</span>) <span class="sc">+</span></span>
<span id="cb36-9"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-9" tabindex="-1"></a> <span class="fu">ggtitle</span>(<span class="st">"Boxplot de Variables de Tortugas"</span>) <span class="sc">+</span></span>
<span id="cb36-10"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb36-10" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">plot.title =</span> <span class="fu">element_text</span>(<span class="at">hjust =</span> <span class="fl">0.5</span>))</span></code></pre></div>
<p><img src="Bookdown_files/figure-html/Boxplot-1.png" width="672" /></p>
</div>
<div id="distancia-de-mahalanobis-entre-los-centroides-de-los-dos-sexos." class="section level3 hasAnchor" number="3.1.3">
<h3><span class="header-section-number">3.1.3</span> Distancia de Mahalanobis entre los centroides de los dos sexos.<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#distancia-de-mahalanobis-entre-los-centroides-de-los-dos-sexos." class="anchor-section" aria-label="Anchor link to header"></a></h3>
<div class="sourceCode" id="cb37"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb37-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-1" tabindex="-1"></a>SxH <span class="ot"><-</span> <span class="fu">cov</span>(tortugas[,<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">3</span>,<span class="dv">5</span>)])</span>
<span id="cb37-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-2" tabindex="-1"></a>SxM <span class="ot"><-</span> <span class="fu">cov</span>(tortugas[,<span class="fu">c</span>(<span class="dv">2</span>,<span class="dv">4</span>,<span class="dv">6</span>)])</span>
<span id="cb37-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-3" tabindex="-1"></a>mahalanobisH <span class="ot"><-</span> <span class="fu">mahalanobis</span>(tortugas[,<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">3</span>,<span class="dv">5</span>)], <span class="fu">colMeans</span>(tortugas[,<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">3</span>,<span class="dv">5</span>)]), SxH)</span>
<span id="cb37-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-4" tabindex="-1"></a>mahalanobisM <span class="ot"><-</span> <span class="fu">mahalanobis</span>(tortugas[,<span class="fu">c</span>(<span class="dv">2</span>,<span class="dv">4</span>,<span class="dv">6</span>)], <span class="fu">colMeans</span>(tortugas[,<span class="fu">c</span>(<span class="dv">2</span>,<span class="dv">4</span>,<span class="dv">6</span>)]), SxM)</span>
<span id="cb37-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-5" tabindex="-1"></a></span>
<span id="cb37-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-6" tabindex="-1"></a><span class="fu">par</span>(<span class="at">mfrow =</span> <span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">2</span>))</span>
<span id="cb37-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb37-7" tabindex="-1"></a><span class="fu">qqPlot</span>(mahalanobisH, <span class="at">distribution =</span><span class="st">"chisq"</span>, <span class="at">df =</span> <span class="dv">3</span> , <span class="at">main =</span><span class="st">"QQ Plot Hembras"</span>, <span class="at">ylab =</span><span class="st">""</span>, <span class="at">las =</span><span class="dv">0</span>)</span></code></pre></div>
<pre><code>[1] 20 24</code></pre>
<div class="sourceCode" id="cb39"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb39-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb39-1" tabindex="-1"></a><span class="fu">title</span>(<span class="at">ylab =</span><span class="st">" Distancias de Mahalanobis "</span>)</span>
<span id="cb39-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb39-2" tabindex="-1"></a></span>
<span id="cb39-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb39-3" tabindex="-1"></a><span class="fu">qqPlot</span>(mahalanobisM, <span class="at">distribution =</span><span class="st">"chisq"</span>, <span class="at">df =</span> <span class="dv">3</span> , <span class="at">main =</span><span class="st">"QQ Plot Machos"</span>, <span class="at">ylab =</span><span class="st">""</span>, <span class="at">las =</span><span class="dv">0</span>)</span></code></pre></div>
<pre><code>[1] 24 1</code></pre>
<div class="sourceCode" id="cb41"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb41-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb41-1" tabindex="-1"></a><span class="fu">title</span>(<span class="at">ylab =</span><span class="st">" Distancias de Mahalanobis "</span>)</span></code></pre></div>
<p><img src="Bookdown_files/figure-html/unnamed-chunk-12-1.png" width="672" /></p>
<div class="sourceCode" id="cb42"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb42-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb42-1" tabindex="-1"></a><span class="fu">par</span>(<span class="at">mfrow =</span> <span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">1</span>))</span></code></pre></div>
</div>
<div id="test-de-kolmogorov-smirnov-y-shapiro-wilk." class="section level3 hasAnchor" number="3.1.4">
<h3><span class="header-section-number">3.1.4</span> Test de Kolmogorov-Smirnov y Shapiro-Wilk.<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#test-de-kolmogorov-smirnov-y-shapiro-wilk." class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>En este apartado, tengase en cuenta el siguiente juego de hipótesis para contrastar la normalidad marginal del conjunto de datos para la prueba de <em>Kolmogorov-Smirnov (KS) </em>y <em>Shapiro-Wilk (SW)</em>.</p>
<ul>
<li>H<span class="math inline">\(_0\)</span>: los datos provienen de una distribución normal</li>
<li>H<span class="math inline">\(_1\)</span>: los datos no provienen de una distribución normal</li>
</ul>
<div class="sourceCode" id="cb43"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb43-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-1" tabindex="-1"></a><span class="co"># funcion para pruebas de normalidad para cada columna individual</span></span>
<span id="cb43-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-2" tabindex="-1"></a>results_KS <span class="ot"><-</span> <span class="fu">lapply</span>(tortugas, <span class="cf">function</span>(x) {</span>
<span id="cb43-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-3" tabindex="-1"></a> <span class="fu">ks.test</span>(x, <span class="st">"pnorm"</span>, <span class="at">mean =</span> <span class="fu">mean</span>(x), <span class="at">sd =</span> <span class="fu">sd</span>(x))</span>
<span id="cb43-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-4" tabindex="-1"></a>})</span>
<span id="cb43-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-5" tabindex="-1"></a></span>
<span id="cb43-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-6" tabindex="-1"></a>results_SW <span class="ot"><-</span> <span class="fu">lapply</span>(tortugas, shapiro.test)</span>
<span id="cb43-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-7" tabindex="-1"></a></span>
<span id="cb43-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-8" tabindex="-1"></a><span class="co"># Combinar los resultados en un marco de datos</span></span>
<span id="cb43-9"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-9" tabindex="-1"></a>results_df <span class="ot"><-</span> <span class="fu">data.frame</span>(</span>
<span id="cb43-10"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-10" tabindex="-1"></a> <span class="at">Variable =</span> <span class="fu">names</span>(tortugas),</span>
<span id="cb43-11"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-11" tabindex="-1"></a> <span class="at">KS_p_value =</span> <span class="fu">sapply</span>(results_KS, <span class="cf">function</span>(x) x<span class="sc">$</span>p.value),</span>
<span id="cb43-12"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-12" tabindex="-1"></a> <span class="at">SW_p_value =</span> <span class="fu">sapply</span>(results_SW, <span class="cf">function</span>(x) x<span class="sc">$</span>p.value)</span>
<span id="cb43-13"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-13" tabindex="-1"></a>)</span>
<span id="cb43-14"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-14" tabindex="-1"></a></span>
<span id="cb43-15"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-15" tabindex="-1"></a><span class="fu">rownames</span>(results_df) <span class="ot"><-</span> <span class="cn">NULL</span></span>
<span id="cb43-16"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-16" tabindex="-1"></a></span>
<span id="cb43-17"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb43-17" tabindex="-1"></a>results_df <span class="sc">%>%</span> <span class="fu">kable</span>() </span></code></pre></div>
<table>
<thead>
<tr class="header">
<th align="left">Variable</th>
<th align="right">KS_p_value</th>
<th align="right">SW_p_value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">length_Hem</td>
<td align="right">0.6409653</td>
<td align="right">0.3458763</td>
</tr>
<tr class="even">
<td align="left">length_Mach</td>
<td align="right">0.9987789</td>
<td align="right">0.7910622</td>
</tr>
<tr class="odd">
<td align="left">width_Hem</td>
<td align="right">0.9553171</td>
<td align="right">0.7440934</td>
</tr>
<tr class="even">
<td align="left">width_Mach</td>
<td align="right">0.9705143</td>
<td align="right">0.8353357</td>
</tr>
<tr class="odd">
<td align="left">height_Hem</td>
<td align="right">0.6751271</td>
<td align="right">0.4921829</td>
</tr>
<tr class="even">
<td align="left">height_Mach</td>
<td align="right">0.7157577</td>
<td align="right">0.3509175</td>
</tr>
</tbody>
</table>
<p>Con la información de la tabla anterior, se observa que los <em>p</em> valores tiene valores altos para cada prueba, que con un <span class="math inline">\(\alpha = 0.05\)</span>, se obtiene que los p-valores > <span class="math inline">\(\alpha\)</span> por lo tanto no se rechaza H<span class="math inline">\(_0\)</span> y se concluye que los datos marginalmente provienen de una distribución normal. Cabe mencionar que para ambos tipos de test esto se ratifica.</p>
</div>
<div id="gráfico-qqplot-multinormalidad-de-los-datos." class="section level3 hasAnchor" number="3.1.5">
<h3><span class="header-section-number">3.1.5</span> Gráfico QQplot multinormalidad de los datos.<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#gráfico-qqplot-multinormalidad-de-los-datos." class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>La figura que se muestra a continuación pretende analizar la normalidad marginal del conjunto de datos <strong>tortugas</strong>. La idea principal es que los puntos se encuentren sobre la linea de referencia (color rojo) para que su comportamiento se considere normal. Por lo tanto, se encuentra que la normalidad parece cumplirse para cada uno de las variables, lo cual concuerda con los test de normalidad realizados en el inciso anterio</p>
<div class="sourceCode" id="cb44"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb44-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-1" tabindex="-1"></a><span class="co"># Función para crear QQ plot</span></span>
<span id="cb44-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-2" tabindex="-1"></a>create_qqplot <span class="ot"><-</span> <span class="cf">function</span>(data, col_name) {</span>
<span id="cb44-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-3" tabindex="-1"></a> <span class="fu">ggplot</span>(data, <span class="fu">aes</span>(<span class="at">sample =</span> .data[[col_name]])) <span class="sc">+</span></span>
<span id="cb44-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-4" tabindex="-1"></a> <span class="fu">geom_qq</span>() <span class="sc">+</span></span>
<span id="cb44-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-5" tabindex="-1"></a> <span class="fu">geom_qq_line</span>(<span class="at">color =</span> <span class="st">"red"</span>) <span class="sc">+</span></span>
<span id="cb44-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-6" tabindex="-1"></a> <span class="fu">labs</span>(<span class="at">title =</span> <span class="fu">paste</span>(<span class="st">"QQ plot"</span>, col_name)) <span class="sc">+</span></span>
<span id="cb44-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-7" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">plot.title =</span> <span class="fu">element_text</span>(<span class="at">hjust =</span> <span class="fl">0.5</span>))</span>
<span id="cb44-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-8" tabindex="-1"></a>}</span>
<span id="cb44-9"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-9" tabindex="-1"></a></span>
<span id="cb44-10"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-10" tabindex="-1"></a><span class="co"># Crear QQ plot para cada columna</span></span>
<span id="cb44-11"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-11" tabindex="-1"></a>qqplots <span class="ot"><-</span> <span class="fu">lapply</span>(<span class="fu">names</span>(tortugas), <span class="cf">function</span>(col) {</span>
<span id="cb44-12"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-12" tabindex="-1"></a> <span class="fu">create_qqplot</span>(tortugas, col)</span>
<span id="cb44-13"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-13" tabindex="-1"></a>})</span>
<span id="cb44-14"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-14" tabindex="-1"></a></span>
<span id="cb44-15"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-15" tabindex="-1"></a><span class="co"># Mostrar los QQ plots en la misma ventana</span></span>
<span id="cb44-16"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb44-16" tabindex="-1"></a><span class="fu">grid.arrange</span>(<span class="at">grobs =</span> qqplots, <span class="at">ncol =</span> <span class="dv">2</span>)</span></code></pre></div>
<p><img src="Bookdown_files/figure-html/unnamed-chunk-14-1.png" width="672" /></p>
</div>
<div id="test-de-shapiro-wilk-multivariado-y-mardia" class="section level3 hasAnchor" number="3.1.6">
<h3><span class="header-section-number">3.1.6</span> Test de Shapiro-Wilk multivariado y Mardia<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#test-de-shapiro-wilk-multivariado-y-mardia" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>A continuación realizaremos test de multinormalidad para cada grupo de tortugas (machos y hembras) usando los test de shapiro-wilk multivariado y el test de Mardia analizando el test de Anderson -Darling. Para el contraste de la shapiro-wilk téngase en cuenta el juego de hipótesis expuesto para la shapiro-wilk univariada</p>
<div class="sourceCode" id="cb45"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb45-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb45-1" tabindex="-1"></a><span class="co"># Resultados de la prueba de Shapiro</span></span>
<span id="cb45-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb45-2" tabindex="-1"></a>ShapiroH <span class="ot"><-</span> <span class="fu">mshapiro.test</span>(<span class="fu">t</span>(tortugas[,<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">3</span>,<span class="dv">5</span>)])); ShapiroH</span></code></pre></div>
<pre><code>
Shapiro-Wilk normality test
data: Z
W = 0.88576, p-value = 0.01087</code></pre>
<div class="sourceCode" id="cb47"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb47-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb47-1" tabindex="-1"></a>ShapiroM <span class="ot"><-</span> <span class="fu">mshapiro.test</span>(<span class="fu">t</span>(tortugas[,<span class="fu">c</span>(<span class="dv">2</span>,<span class="dv">4</span>,<span class="dv">6</span>)])); ShapiroM</span></code></pre></div>
<pre><code>
Shapiro-Wilk normality test
data: Z
W = 0.94247, p-value = 0.1851</code></pre>
<p>Teniendo en cuenta los p-valores para cada uno de los grupos y un <span class="math inline">\(\alpha = 0.05\)</span>, se concluye que hay evidencia significativa para rechzar la multinormalidad en los datos del grupo de las hembras dado que el p-valor < <span class="math inline">\(\alpha\)</span>. Contrario a lo que sucede con las tortugas machos, cuyo p-valor > <span class="math inline">\(\alpha\)</span> lo que indica que hay evidencia significativa para aceptar la multinormalidad para este grupo.</p>
<div class="sourceCode" id="cb49"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb49-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb49-1" tabindex="-1"></a><span class="co"># Resultados de la prueba de Mardia</span></span>
<span id="cb49-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb49-2" tabindex="-1"></a>mardiaH <span class="ot"><-</span> <span class="fu">mvn</span>(<span class="at">data =</span> tortugas[,<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">3</span>,<span class="dv">5</span>)], <span class="at">mvnTest =</span> <span class="st">"mardia"</span>); mardiaH[<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">2</span>)]</span></code></pre></div>
<pre><code>$multivariateNormality
Test Statistic p value Result
1 Mardia Skewness 19.2915141939567 0.0367124740909937 NO
2 Mardia Kurtosis 0.356039059194154 0.721811314232731 YES
3 MVN <NA> <NA> NO
$univariateNormality
Test Variable Statistic p value Normality
1 Anderson-Darling length_Hem 0.4283 0.2863 YES
2 Anderson-Darling width_Hem 0.2367 0.7609 YES
3 Anderson-Darling height_Hem 0.3218 0.5099 YES </code></pre>
<div class="sourceCode" id="cb51"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb51-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb51-1" tabindex="-1"></a>mardiaM <span class="ot"><-</span> <span class="fu">mvn</span>(<span class="at">data =</span> tortugas[,<span class="fu">c</span>(<span class="dv">2</span>,<span class="dv">4</span>,<span class="dv">6</span>)], <span class="at">mvnTest =</span> <span class="st">"mardia"</span>); mardiaM[<span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">2</span>)]</span></code></pre></div>
<pre><code>$multivariateNormality
Test Statistic p value Result
1 Mardia Skewness 5.14510497861245 0.881276336058678 YES
2 Mardia Kurtosis -0.291653421791725 0.770551625535058 YES
3 MVN <NA> <NA> YES
$univariateNormality
Test Variable Statistic p value Normality
1 Anderson-Darling length_Mach 0.1771 0.9105 YES
2 Anderson-Darling width_Mach 0.2374 0.7584 YES
3 Anderson-Darling height_Mach 0.4284 0.2862 YES </code></pre>
<p>Teniendo en cuenta el test de Mardia para cada grupo se observa lo siguiente:</p>
<ul>
<li><p><strong>Mardia Skewness</strong>: La estadística de asimetría de Mardia es 19.29 para las hembras y 5.14 para los machos, y el valor p asociado es 0.03 y 0.88, respecticamente. Lo que indica que hay evidencia suficiente para rechazar la hipótesis nula de asimetría multivariada para la hembras, mientras que para los machos no hay evidencia suficiente para rechazar.</p></li>
<li><p><strong>Mardia Kurtosis</strong>: La estadística de curtosis de Mardia es de 0.35 para las hembras y -0.29 para los machos. Los valores p asociado a cada grupo es 0.72 y 0.77 respectivamente, lo que sugiere que no hay suficiente evidencia para rechazar la hipótesis nula de curtosis multivariada para ambos grupos.</p></li>
<li><p>En el test de <strong>Anderson-Darling</strong> muestra que existe evidencia significativa para no rechazar la normalidad marginal para las variables de cada grupo, dado que los p-valores > <span class="math inline">\(\alpha\)</span>.</p></li>
</ul>
</div>
<div id="diferencias-estadísticas-fuertes-entre-dichos-géneros." class="section level3 hasAnchor" number="3.1.7">
<h3><span class="header-section-number">3.1.7</span> Diferencias estadísticas fuertes entre dichos géneros.<a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#diferencias-estadísticas-fuertes-entre-dichos-géneros." class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>Para esto realizaremosdos tipos de hipótesis: test de comparacion de matrizde varianzas y covarianzas y test de comparación de medias. Esto comparando los grupos <strong>machos</strong> y <strong>hembras</strong>. Para esto, realizaremos en primera instancia el test contrastar matriz de varianzas y covarianzas, con el siguiente juego de hipótesis:</p>
<ul>
<li>H<span class="math inline">\(_0\)</span> : <span class="math inline">\(\mathbf{\Sigma}_1 - \mathbf{\Sigma}_2 = \mathbf{0}\)</span>.</li>
<li>H<span class="math inline">\(_1\)</span> : <span class="math inline">\(\mathbf{\Sigma}_1 - \mathbf{\Sigma}_2 \neq \mathbf{0}\)</span>.</li>
</ul>
<p>Así, el proceso de juzgamiento esta dado a continuación:</p>
<div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb53-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-1" tabindex="-1"></a>testPobs <span class="ot"><-</span> <span class="cf">function</span>(..., alpha){</span>
<span id="cb53-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-2" tabindex="-1"></a> pobs <span class="ot"><-</span> <span class="fu">list</span>(...)</span>
<span id="cb53-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-3" tabindex="-1"></a> ns <span class="ot"><-</span> <span class="fu">sapply</span>(pobs, nrow)</span>
<span id="cb53-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-4" tabindex="-1"></a> p <span class="ot"><-</span> <span class="fu">ncol</span>(pobs[[<span class="dv">1</span>]])</span>
<span id="cb53-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-5" tabindex="-1"></a> q <span class="ot"><-</span> <span class="fu">length</span>(pobs)</span>
<span id="cb53-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-6" tabindex="-1"></a> df <span class="ot"><-</span> (<span class="dv">1</span><span class="sc">/</span><span class="dv">2</span>)<span class="sc">*</span>p<span class="sc">*</span>(p<span class="sc">+</span><span class="dv">1</span>)<span class="sc">*</span>(q<span class="dv">-1</span>)</span>
<span id="cb53-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-7" tabindex="-1"></a> nui <span class="ot"><-</span> (ns<span class="dv">-1</span>)</span>
<span id="cb53-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-8" tabindex="-1"></a> nu <span class="ot"><-</span> <span class="fu">sum</span>(nui)</span>
<span id="cb53-9"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-9" tabindex="-1"></a> rho <span class="ot"><-</span> rho <span class="ot"><-</span> <span class="dv">1</span> <span class="sc">-</span> (((<span class="dv">2</span><span class="sc">*</span>p<span class="sc">^</span><span class="dv">2</span><span class="sc">+</span><span class="dv">3</span><span class="sc">*</span>p<span class="dv">-1</span>)<span class="sc">/</span>(<span class="dv">6</span><span class="sc">*</span>(p<span class="sc">+</span><span class="dv">1</span>)<span class="sc">*</span>(q<span class="dv">-1</span>)))<span class="sc">*</span>(<span class="fu">sum</span>(<span class="dv">1</span><span class="sc">/</span>nui) <span class="sc">-</span> <span class="dv">1</span><span class="sc">/</span>nu))</span>
<span id="cb53-10"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-10" tabindex="-1"></a> S <span class="ot"><-</span> <span class="fu">list</span>()</span>
<span id="cb53-11"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-11" tabindex="-1"></a> <span class="cf">for</span> (i <span class="cf">in</span> <span class="dv">1</span><span class="sc">:</span><span class="fu">length</span>(pobs)){</span>
<span id="cb53-12"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-12" tabindex="-1"></a> S[[i]] <span class="ot"><-</span> <span class="fu">cov</span>(pobs[[i]])</span>
<span id="cb53-13"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-13" tabindex="-1"></a> }</span>
<span id="cb53-14"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-14" tabindex="-1"></a> x <span class="ot"><-</span> <span class="dv">0</span></span>
<span id="cb53-15"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-15" tabindex="-1"></a> <span class="cf">for</span> (i <span class="cf">in</span> <span class="dv">1</span><span class="sc">:</span><span class="fu">length</span>(S)){</span>
<span id="cb53-16"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-16" tabindex="-1"></a> x1 <span class="ot"><-</span> nui[i]<span class="sc">*</span>S[[i]]</span>
<span id="cb53-17"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-17" tabindex="-1"></a> x <span class="ot"><-</span> x <span class="sc">+</span> x1</span>
<span id="cb53-18"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-18" tabindex="-1"></a> }</span>
<span id="cb53-19"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-19" tabindex="-1"></a> sp <span class="ot"><-</span> x<span class="sc">/</span>nu</span>
<span id="cb53-20"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-20" tabindex="-1"></a> logS <span class="ot"><-</span> <span class="fu">sapply</span>(S, <span class="cf">function</span>(s) <span class="fu">determinant</span>(s, <span class="at">log=</span><span class="cn">TRUE</span>)<span class="sc">$</span>mod[<span class="dv">1</span>])</span>
<span id="cb53-21"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-21" tabindex="-1"></a> logSP <span class="ot"><-</span> <span class="fu">determinant</span>(sp, <span class="at">log =</span> <span class="cn">TRUE</span>)<span class="sc">$</span>mod[<span class="dv">1</span>]</span>
<span id="cb53-22"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-22" tabindex="-1"></a> logM <span class="ot"><-</span> rho<span class="sc">*</span>(<span class="fu">sum</span>(nui<span class="sc">*</span>logSP) <span class="sc">-</span> <span class="fu">sum</span>(nui<span class="sc">*</span>logS))</span>
<span id="cb53-23"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-23" tabindex="-1"></a> tab <span class="ot"><-</span> <span class="fu">qchisq</span>(alpha, <span class="at">df =</span> df, <span class="at">lower.tail =</span> <span class="cn">FALSE</span>)</span>
<span id="cb53-24"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-24" tabindex="-1"></a> p_value <span class="ot"><-</span> <span class="fu">pchisq</span>(logM, df, <span class="at">lower.tail =</span> <span class="cn">FALSE</span>)</span>
<span id="cb53-25"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-25" tabindex="-1"></a> tabla <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="st">'Valor Tab'</span> <span class="ot">=</span> tab,</span>
<span id="cb53-26"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-26" tabindex="-1"></a> <span class="st">'Est. Prueba'</span> <span class="ot">=</span> logM,</span>
<span id="cb53-27"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-27" tabindex="-1"></a> <span class="st">'p-value'</span> <span class="ot">=</span> p_value)</span>
<span id="cb53-28"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-28" tabindex="-1"></a> <span class="fu">row.names</span>(tabla) <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">'Test Varianzas'</span>)</span>
<span id="cb53-29"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-29" tabindex="-1"></a> <span class="fu">print</span>(tabla)</span>
<span id="cb53-30"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-30" tabindex="-1"></a>}</span>
<span id="cb53-31"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-31" tabindex="-1"></a></span>
<span id="cb53-32"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb53-32" tabindex="-1"></a><span class="fu">testPobs</span>(<span class="fu">as.matrix</span>(tortugas[, <span class="fu">c</span>(<span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">5</span>)]), <span class="fu">as.matrix</span>(tortugas[, <span class="fu">c</span>(<span class="dv">2</span>, <span class="dv">4</span>, <span class="dv">6</span>)]), <span class="at">alpha =</span> <span class="fl">0.05</span>)</span></code></pre></div>
<pre><code> Valor.Tab Est..Prueba p.value
Test Varianzas 12.59159 28.26133 8.388967e-05</code></pre>
<p>Teniendo en cuenta la información de la tabla anterior y definido un <span class="math inline">\(\alpha = 0.05\)</span> se obtiene que el p-valor < <span class="math inline">\(\alpha\)</span> por lo tanto se rechaza H<span class="math inline">\(_0\)</span> y no se rechaza H<span class="math inline">\(_1\)</span> lo que nos lleva a que existen diferencias significativas en la matriz de varianzas y covarianzas de las tortugas hembras y machos.</p>
<p>Considerando que existen diferencias significativas entre las matrices de varianzas y covarianzas de las tortugas hembras y machos y que el numero de tortugas observadas es igual para cada grupo, se propone comparar las medias de cada grupo usando el test de muestras paredas, con el siguiente juego de hipótesis:</p>
<ul>
<li><p>Ho: <span class="math inline">\(\mathbf{\mu}_1 = \mathbf{\mu}_2\)</span></p></li>
<li><p>H1: <span class="math inline">\(\mathbf{\mu}_1 \neq \mathbf{\mu}_2\)</span></p></li>
</ul>
<div class="sourceCode" id="cb55"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb55-1"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-1" tabindex="-1"></a>PareadasTest <span class="ot"><-</span> <span class="cf">function</span>(Pob1, Pob2){</span>
<span id="cb55-2"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-2" tabindex="-1"></a> n <span class="ot"><-</span> <span class="fu">nrow</span>(Pob1)</span>
<span id="cb55-3"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-3" tabindex="-1"></a> p <span class="ot"><-</span> <span class="fu">ncol</span>(Pob1)</span>
<span id="cb55-4"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-4" tabindex="-1"></a> distan <span class="ot"><-</span> (Pob1 <span class="sc">-</span> Pob2)</span>
<span id="cb55-5"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-5" tabindex="-1"></a> distanMean <span class="ot"><-</span> <span class="fu">matrix</span>(<span class="fu">colMeans</span>(distan))</span>
<span id="cb55-6"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-6" tabindex="-1"></a> Sd <span class="ot"><-</span> <span class="fu">cov</span>(distan)</span>
<span id="cb55-7"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-7" tabindex="-1"></a> T2 <span class="ot"><-</span> n<span class="sc">*</span><span class="fu">t</span>(distanMean)<span class="sc">%*%</span><span class="fu">solve</span>(Sd)<span class="sc">%*%</span>distanMean</span>
<span id="cb55-8"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-8" tabindex="-1"></a> T20 <span class="ot"><-</span> (T2<span class="sc">/</span>(n<span class="dv">-1</span>))<span class="sc">*</span>((n<span class="sc">-</span>p)<span class="sc">/</span>p)</span>
<span id="cb55-9"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-9" tabindex="-1"></a> P_value <span class="ot"><-</span> <span class="fu">pf</span>(T20, p, n<span class="dv">-1</span>, <span class="at">lower.tail =</span> <span class="cn">FALSE</span>)</span>
<span id="cb55-10"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-10" tabindex="-1"></a> Quan <span class="ot"><-</span> <span class="fu">qf</span>(<span class="fl">0.05</span>, p, n<span class="dv">-1</span>, <span class="at">lower.tail =</span> <span class="cn">FALSE</span>)</span>
<span id="cb55-11"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-11" tabindex="-1"></a> <span class="fu">print</span>(<span class="fu">data.frame</span>(<span class="at">T20 =</span> T20, <span class="at">Cuantil =</span> Quan, <span class="at">P_valor =</span> P_value))</span>
<span id="cb55-12"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-12" tabindex="-1"></a>}</span>
<span id="cb55-13"><a href="distribution-of-tortoises-and-freshwater-turtles-of-the-colombian-caribbean.html#cb55-13" tabindex="-1"></a><span class="fu">PareadasTest</span>(tortugas[, <span class="fu">c</span>(<span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">5</span>)], tortugas[, <span class="fu">c</span>(<span class="dv">2</span>, <span class="dv">4</span>, <span class="dv">6</span>)])</span></code></pre></div>
<pre><code> T20 Cuantil P_valor
1 35.43449 3.027998 8.59217e-09</code></pre>
<p>Teniendo en cuenta la información de la tabla anterior y definido un <span class="math inline">\(\alpha = 0.05\)</span> se obtiene que el p-valor < <span class="math inline">\(\alpha\)</span> por lo tanto se rechaza H<span class="math inline">\(_0\)</span> y no se rechaza H<span class="math inline">\(_1\)</span> lo que nos lleva a que existen diferencias significativas en las medias de las tortugas hembras y machos.</p>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<a href="inferencia-a-partir-de-la-matriz-de-covarianza.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="mediciones-morfométricas-de-104-zarigueyas-capturadas.html" class="navigation navigation-next " aria-label="Next page"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"whatsapp": false,
"all": ["facebook", "twitter", "linkedin", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": "https://github.com/rstudio/bookdown-demo/edit/master/index.Rmd",
"text": "Edit"
},
"history": {
"link": null,
"text": null
},
"view": {
"link": null,
"text": null
},
"download": ["Bookdown.pdf", "Bookdown.epub"],
"search": {
"engine": "fuse",
"options": null
},
"toc": {
"collapse": "subsection"
}
});
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "true";
if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:")
if (/^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>