-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
349 lines (305 loc) · 28.3 KB
/
index.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
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Introduccion a los Metodos de Análisis Multivariados</title>
<meta name="description" content="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="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="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="next" href="inferencia-a-partir-de-la-matriz-de-covarianza.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="header">
<h1 class="title">Introduccion a los Metodos de Análisis Multivariados</h1>
<p class="author"><em>Jose Angel Urquijo Parra</em></p>
</div>
<div id="estadístico-t2-hoteling" class="section level1 hasAnchor" number="1">
<h1><span class="header-section-number"> 1</span> Estadístico T2 Hoteling<a href="index.html#estadístico-t2-hoteling" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<div id="estadístico-t2-hoteling-para-muestras-independientes" class="section level2 hasAnchor" number="1.1">
<h2><span class="header-section-number">1.1</span> Estadístico T2 Hoteling para muestras independientes<a href="index.html#estadístico-t2-hoteling-para-muestras-independientes" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="index.html#cb2-1" tabindex="-1"></a>consumo <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x1 =</span> <span class="fu">c</span>(<span class="dv">72</span>, <span class="fl">66.5</span>, <span class="dv">54</span>, <span class="dv">67</span>, <span class="dv">44</span>, <span class="dv">41</span>, <span class="fl">34.5</span>, <span class="fl">34.5</span>, <span class="dv">24</span>),</span>
<span id="cb2-2"><a href="index.html#cb2-2" tabindex="-1"></a> <span class="at">x2 =</span> <span class="fu">c</span>(<span class="dv">50</span>, <span class="dv">48</span>, <span class="dv">57</span>, <span class="dv">60</span>, <span class="dv">57</span>, <span class="dv">52</span>, <span class="dv">50</span>,<span class="dv">46</span>, <span class="dv">54</span>), </span>
<span id="cb2-3"><a href="index.html#cb2-3" tabindex="-1"></a> <span class="at">x3 =</span> <span class="fu">c</span>(<span class="dv">8</span>, <span class="dv">15</span>, <span class="dv">14</span>, <span class="dv">15</span>, <span class="dv">14</span>, <span class="dv">18</span>, <span class="dv">4</span>, <span class="fl">8.5</span>, <span class="dv">3</span>),</span>
<span id="cb2-4"><a href="index.html#cb2-4" tabindex="-1"></a> <span class="at">x4 =</span> <span class="fu">c</span>(<span class="fl">0.5</span>, <span class="fl">1.0</span>, <span class="fl">1.0</span>, <span class="fl">0.9</span>, <span class="fl">0.3</span>, <span class="dv">19</span>, <span class="fl">0.5</span>, <span class="fl">1.0</span>, <span class="fl">1.2</span>))</span>
<span id="cb2-5"><a href="index.html#cb2-5" tabindex="-1"></a></span>
<span id="cb2-6"><a href="index.html#cb2-6" tabindex="-1"></a>produccion <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">y1 =</span> <span class="fu">c</span>(<span class="dv">57</span>, <span class="dv">100</span>, <span class="dv">100</span>, <span class="fl">96.5</span>, <span class="dv">79</span>, <span class="fl">78.5</span>, <span class="dv">48</span>, <span class="dv">155</span>, <span class="dv">84</span>, <span class="dv">105</span>),</span>
<span id="cb2-7"><a href="index.html#cb2-7" tabindex="-1"></a> <span class="at">y2 =</span> <span class="fu">c</span>(<span class="dv">57</span>, <span class="dv">54</span>, <span class="dv">32</span>, <span class="dv">65</span>, <span class="dv">51</span>, <span class="dv">53</span>, <span class="dv">50</span>, <span class="dv">44</span>, <span class="dv">64</span>, <span class="dv">35</span>), </span>
<span id="cb2-8"><a href="index.html#cb2-8" tabindex="-1"></a> <span class="at">y3 =</span> <span class="fu">c</span>(<span class="fl">12.5</span>, <span class="dv">17</span>, <span class="fl">16.5</span>, <span class="fl">20.5</span>, <span class="dv">18</span>, <span class="dv">18</span>, <span class="dv">21</span>, <span class="fl">20.5</span>, <span class="dv">13</span>, <span class="dv">17</span>),</span>
<span id="cb2-9"><a href="index.html#cb2-9" tabindex="-1"></a> <span class="at">y4 =</span> <span class="fu">c</span>(<span class="fl">0.9</span>, <span class="fl">0.5</span>, <span class="fl">0.7</span>, <span class="fl">0.9</span>, <span class="fl">0.9</span>,<span class="fl">1.2</span>, <span class="fl">1.6</span>, <span class="fl">1.4</span>, <span class="fl">0.8</span>, <span class="fl">1.8</span>))</span>
<span id="cb2-10"><a href="index.html#cb2-10" tabindex="-1"></a></span>
<span id="cb2-11"><a href="index.html#cb2-11" tabindex="-1"></a></span>
<span id="cb2-12"><a href="index.html#cb2-12" tabindex="-1"></a>consumo <span class="ot">=</span> <span class="fu">as.matrix</span>(consumo)</span>
<span id="cb2-13"><a href="index.html#cb2-13" tabindex="-1"></a>produccion <span class="ot">=</span> <span class="fu">as.matrix</span>(produccion)</span>
<span id="cb2-14"><a href="index.html#cb2-14" tabindex="-1"></a></span>
<span id="cb2-15"><a href="index.html#cb2-15" tabindex="-1"></a>n1<span class="ot">=</span><span class="dv">9</span></span>
<span id="cb2-16"><a href="index.html#cb2-16" tabindex="-1"></a>n2<span class="ot">=</span><span class="dv">10</span></span>
<span id="cb2-17"><a href="index.html#cb2-17" tabindex="-1"></a></span>
<span id="cb2-18"><a href="index.html#cb2-18" tabindex="-1"></a>s1<span class="ot">=</span><span class="fu">cov</span>(consumo)</span>
<span id="cb2-19"><a href="index.html#cb2-19" tabindex="-1"></a>s2<span class="ot">=</span><span class="fu">cov</span>(produccion)</span>
<span id="cb2-20"><a href="index.html#cb2-20" tabindex="-1"></a></span>
<span id="cb2-21"><a href="index.html#cb2-21" tabindex="-1"></a>spl<span class="ot">=</span>((n1<span class="dv">-1</span>)<span class="sc">*</span>s1<span class="sc">+</span>(n2<span class="dv">-1</span>)<span class="sc">*</span>s2)<span class="sc">/</span>(n1<span class="sc">+</span>n2<span class="dv">-2</span>)</span>
<span id="cb2-22"><a href="index.html#cb2-22" tabindex="-1"></a></span>
<span id="cb2-23"><a href="index.html#cb2-23" tabindex="-1"></a>y1<span class="ot">=</span><span class="fu">apply</span>(consumo,<span class="dv">2</span>,mean)</span>
<span id="cb2-24"><a href="index.html#cb2-24" tabindex="-1"></a>y2<span class="ot">=</span><span class="fu">apply</span>(produccion,<span class="dv">2</span>,mean)</span>
<span id="cb2-25"><a href="index.html#cb2-25" tabindex="-1"></a></span>
<span id="cb2-26"><a href="index.html#cb2-26" tabindex="-1"></a>t2<span class="ot">=</span>((n1<span class="sc">*</span>n2)<span class="sc">/</span>(n1<span class="sc">+</span>n2))<span class="sc">*</span>(y1<span class="sc">-</span>y2)<span class="sc">%*%</span><span class="fu">solve</span>(spl)<span class="sc">%*%</span>(y1<span class="sc">-</span>y2)</span>
<span id="cb2-27"><a href="index.html#cb2-27" tabindex="-1"></a></span>
<span id="cb2-28"><a href="index.html#cb2-28" tabindex="-1"></a>p<span class="ot">=</span><span class="dv">4</span></span>
<span id="cb2-29"><a href="index.html#cb2-29" tabindex="-1"></a>cal<span class="ot">=</span>((n1<span class="sc">+</span>n2<span class="sc">-</span>p<span class="dv">-1</span>)<span class="sc">/</span>(p<span class="sc">*</span>(n1<span class="sc">+</span>n2<span class="dv">-2</span>))<span class="sc">*</span>t2);cal</span></code></pre></div>
<pre><code> [,1]
[1,] 4.561045</code></pre>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="index.html#cb4-1" tabindex="-1"></a>valorp<span class="ot">=</span> (<span class="fu">pf</span>(cal,p,n1<span class="sc">+</span>n2<span class="sc">-</span>p<span class="dv">-1</span>, <span class="at">lower.tail=</span>F));valorp</span></code></pre></div>
<pre><code> [,1]
[1,] 0.01443042</code></pre>
</div>
<div id="estadístico-t2-hoteling-para-muestras-relacionadas" class="section level2 hasAnchor" number="1.2">
<h2><span class="header-section-number">1.2</span> Estadístico T2 Hoteling para muestras relacionadas<a href="index.html#estadístico-t2-hoteling-para-muestras-relacionadas" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="index.html#cb6-1" tabindex="-1"></a>esmalte1 <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x1 =</span> <span class="fu">c</span>(<span class="dv">73</span>, <span class="dv">43</span>, <span class="dv">47</span>, <span class="dv">53</span>, <span class="dv">58</span>, <span class="dv">47</span>, <span class="dv">52</span>, <span class="dv">38</span>, <span class="dv">61</span>, <span class="dv">56</span>, <span class="dv">56</span>, <span class="dv">34</span>, <span class="dv">55</span>, <span class="dv">65</span>, <span class="dv">75</span>),</span>
<span id="cb6-2"><a href="index.html#cb6-2" tabindex="-1"></a> <span class="at">x2 =</span> <span class="fu">c</span>(<span class="dv">31</span>, <span class="dv">19</span>, <span class="dv">22</span>, <span class="dv">26</span>, <span class="dv">36</span>, <span class="dv">30</span>, <span class="dv">29</span>, <span class="dv">36</span>, <span class="dv">34</span>, <span class="dv">33</span>, <span class="dv">19</span>, <span class="dv">19</span>, <span class="dv">26</span>, <span class="dv">15</span>, <span class="dv">18</span>))</span>
<span id="cb6-3"><a href="index.html#cb6-3" tabindex="-1"></a></span>
<span id="cb6-4"><a href="index.html#cb6-4" tabindex="-1"></a>esmalte2 <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">y1 =</span> <span class="fu">c</span>(<span class="dv">51</span>, <span class="dv">41</span>, <span class="dv">43</span>, <span class="dv">41</span>, <span class="dv">47</span>, <span class="dv">32</span>, <span class="dv">24</span>, <span class="dv">43</span>, <span class="dv">53</span>, <span class="dv">52</span>, <span class="dv">57</span>, <span class="dv">44</span>, <span class="dv">57</span>, <span class="dv">40</span>, <span class="dv">68</span>),</span>
<span id="cb6-5"><a href="index.html#cb6-5" tabindex="-1"></a> <span class="at">y2 =</span> <span class="fu">c</span>(<span class="dv">35</span>, <span class="dv">14</span>, <span class="dv">19</span>, <span class="dv">29</span>, <span class="dv">34</span>, <span class="dv">26</span>, <span class="dv">19</span>, <span class="dv">37</span>, <span class="dv">24</span>, <span class="dv">27</span>, <span class="dv">14</span>, <span class="dv">19</span>, <span class="dv">30</span>, <span class="dv">7</span>, <span class="dv">13</span>))</span>
<span id="cb6-6"><a href="index.html#cb6-6" tabindex="-1"></a></span>
<span id="cb6-7"><a href="index.html#cb6-7" tabindex="-1"></a></span>
<span id="cb6-8"><a href="index.html#cb6-8" tabindex="-1"></a>esmalte1 <span class="ot">=</span> <span class="fu">as.matrix</span>(esmalte1)</span>
<span id="cb6-9"><a href="index.html#cb6-9" tabindex="-1"></a>esmalte2 <span class="ot">=</span> <span class="fu">as.matrix</span>(esmalte2)</span>
<span id="cb6-10"><a href="index.html#cb6-10" tabindex="-1"></a></span>
<span id="cb6-11"><a href="index.html#cb6-11" tabindex="-1"></a>dif<span class="ot">=</span>esmalte1<span class="sc">-</span>esmalte2</span>
<span id="cb6-12"><a href="index.html#cb6-12" tabindex="-1"></a>dbarra<span class="ot">=</span><span class="fu">apply</span>(dif,<span class="dv">2</span>,mean)</span>
<span id="cb6-13"><a href="index.html#cb6-13" tabindex="-1"></a>sd<span class="ot">=</span><span class="fu">cov</span>(dif)</span>
<span id="cb6-14"><a href="index.html#cb6-14" tabindex="-1"></a>n<span class="ot">=</span><span class="dv">14</span></span>
<span id="cb6-15"><a href="index.html#cb6-15" tabindex="-1"></a></span>
<span id="cb6-16"><a href="index.html#cb6-16" tabindex="-1"></a>t2<span class="ot">=</span>(n<span class="sc">*</span>dbarra<span class="sc">%*%</span><span class="fu">solve</span>(sd)<span class="sc">%*%</span>dbarra);t2</span></code></pre></div>
<pre><code> [,1]
[1,] 10.09764</code></pre>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="index.html#cb8-1" tabindex="-1"></a>v<span class="ot">=</span>n<span class="dv">-1</span></span>
<span id="cb8-2"><a href="index.html#cb8-2" tabindex="-1"></a>p<span class="ot">=</span><span class="dv">4</span></span>
<span id="cb8-3"><a href="index.html#cb8-3" tabindex="-1"></a></span>
<span id="cb8-4"><a href="index.html#cb8-4" tabindex="-1"></a>cal<span class="ot">=</span>((v<span class="sc">-</span>p<span class="sc">+</span><span class="dv">1</span>)<span class="sc">/</span>(v<span class="sc">*</span>p))<span class="sc">*</span>t2</span>
<span id="cb8-5"><a href="index.html#cb8-5" tabindex="-1"></a></span>
<span id="cb8-6"><a href="index.html#cb8-6" tabindex="-1"></a>valorp <span class="ot">=</span> (<span class="fu">pf</span>(cal,p,v<span class="sc">-</span>p<span class="sc">+</span><span class="dv">1</span>, <span class="at">lower.tail=</span>F));valorp</span></code></pre></div>
<pre><code> [,1]
[1,] 0.1799308</code></pre>
<p>No rechace Ho. Existe evidencia estadistica de que no hay diferencias en el grosor de los arboles en las cuatro posiciones medidas, con una significancia del 0.05.</p>
</div>
</div>
</section>
</div>
</div>
</div>
<a href="inferencia-a-partir-de-la-matriz-de-covarianza.html" class="navigation navigation-next navigation-unique" 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>