Skip to content

Commit

Permalink
modul psd 8 9 rev
Browse files Browse the repository at this point in the history
  • Loading branch information
AgungSudanta committed Nov 25, 2024
1 parent ba62f67 commit 72901bd
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions docs/search.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions docs/semuahalaman/modulprak/2024/ganjil/psd/modul9.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="dcterms.date" content="2024-11-25">
<meta name="description" content="Offline di Departemen Matematika">

<title>(Pertemuan 09) ANOVA dan Chi-Squared – Lab Praktikum Departemen Matematika FMIPA UI</title>
<title>(Pertemuan 09) ANOVA dan Uji Chi-Squared – Lab Praktikum Departemen Matematika FMIPA UI</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand Down Expand Up @@ -208,8 +208,8 @@ <h2 id="toc-title">On this page</h2>

<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">(Pertemuan 09) ANOVA dan Chi-Squared</h1>
<p class="subtitle lead">ANOVA and Chi-Squared</p>
<h1 class="title">(Pertemuan 09) ANOVA dan Uji Chi-Squared</h1>
<p class="subtitle lead">ANOVA and Chi-Squared Test</p>
</div>

<div>
Expand Down Expand Up @@ -274,9 +274,9 @@ <h2 class="anchored" data-anchor-id="ukuran-sampel-seragam">Ukuran Sampel Seraga
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">function</span>(x) <span class="fu">c</span>(<span class="at">mean =</span> <span class="fu">mean</span>(x),<span class="at">sd =</span> <span class="fu">sd</span>(x)))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> pop.source pops.value.mean pops.value.sd
1 pops.1 1.0025509 1.1154917
2 pops.2 1.3577494 0.9804963
3 pops.3 0.8434632 0.8088781</code></pre>
1 pops.1 0.7641406 0.9870588
2 pops.2 0.9432723 1.2528974
3 pops.3 0.8596178 0.6817645</code></pre>
</div>
</div>
<div class="cell">
Expand Down Expand Up @@ -305,7 +305,7 @@ <h2 class="anchored" data-anchor-id="ukuran-sampel-seragam">Ukuran Sampel Seraga
One-way analysis of means

data: pops.value and pop.source
F = 0.72722, num df = 2, denom df = 27, p-value = 0.4925</code></pre>
F = 0.080101, num df = 2, denom df = 27, p-value = 0.9232</code></pre>
</div>
</div>
<p>Fungsi lain yang dapat digunakan adalah aov()</p>
Expand All @@ -314,8 +314,8 @@ <h2 class="anchored" data-anchor-id="ukuran-sampel-seragam">Ukuran Sampel Seraga
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(av)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> Df Sum Sq Mean Sq F value Pr(&gt;F)
pop.source 2 1.387 0.6933 0.727 0.492
Residuals 27 25.740 0.9533 </code></pre>
pop.source 2 0.161 0.0803 0.08 0.923
Residuals 27 27.080 1.0029 </code></pre>
</div>
</div>
<p>Ingat lagi bahwa daerah kritis uji ANOVA adalah:</p>
Expand Down Expand Up @@ -366,16 +366,16 @@ <h2 class="anchored" data-anchor-id="ukuran-sampel-tidak-seragam">Ukuran Sampel
One-way analysis of means

data: pops.value and pop.source
F = 0.98669, num df = 2, denom df = 31, p-value = 0.3842</code></pre>
F = 0.4461, num df = 2, denom df = 31, p-value = 0.6442</code></pre>
</div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>av <span class="ot">&lt;-</span> <span class="fu">aov</span>(pops.value <span class="sc">~</span> pop.source, <span class="at">data =</span> data)</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(av)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> Df Sum Sq Mean Sq F value Pr(&gt;F)
pop.source 2 2.17 1.085 0.987 0.384
Residuals 31 34.09 1.100 </code></pre>
pop.source 2 0.511 0.2556 0.446 0.644
Residuals 31 17.764 0.5730 </code></pre>
</div>
</div>
<p>Ingat lagi bahwa daerah kritis uji ANOVA adalah:</p>
Expand Down Expand Up @@ -444,10 +444,10 @@ <h3 class="anchored" data-anchor-id="menggunakan-statistik-uji">Menggunakan stat
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a>dadu <span class="ot">&lt;-</span> <span class="fu">ceiling</span>(<span class="fu">runif</span>(<span class="at">n=</span>n_dadu, <span class="at">min =</span> <span class="dv">0</span>, <span class="at">max=</span><span class="dv">6</span>))</span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a>dadu</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> [1] 2 2 5 6 3 2 3 4 3 4 5 3 4 4 4 1 4 4 1 5 1 6 3 1 4 4 1 2 3 5 5 5 2 6 3 4 1
[38] 1 2 3 5 6 1 5 3 2 6 5 3 2 5 5 2 6 5 2 6 1 5 6 2 6 5 6 4 6 3 4 4 4 3 5 1 3
[75] 2 2 3 5 2 6 3 3 5 5 4 2 4 2 1 6 1 4 3 1 3 1 2 6 4 6 1 6 2 1 1 2 3 3 4 5 1
[112] 1 6 6 5 4 4 4 2 5</code></pre>
<pre><code> [1] 2 6 5 4 6 6 1 2 3 4 3 5 5 6 6 5 1 5 3 5 5 5 5 6 5 2 4 5 1 5 2 3 6 3 3 5 6
[38] 3 6 6 2 4 1 4 6 3 2 3 1 6 2 6 5 4 3 4 2 5 6 6 5 4 3 1 5 3 6 1 6 4 2 4 1 4
[75] 4 6 1 4 2 5 2 5 6 1 2 4 4 6 3 1 4 3 4 6 5 6 6 2 2 6 2 1 2 4 2 6 4 6 3 2 3
[112] 1 6 4 1 4 3 1 4 3</code></pre>
</div>
</div>
<p>Dengan cara yang sama, kita dapat melakukan uji chi-squared</p>
Expand All @@ -464,7 +464,7 @@ <h3 class="anchored" data-anchor-id="menggunakan-statistik-uji">Menggunakan stat
Chi-squared test for given probabilities

data: dadu
X-squared = 95.429, df = 119, p-value = 0.945</code></pre>
X-squared = 91.725, df = 119, p-value = 0.97</code></pre>
</div>
</div>
<p>Terdapat pesan “Warning: Chi-squared approximation may be incorrect”. Hal ini terjadi karena terdapat beberapa pengulangan nilai pada ruang sampel, di mana masing-masing nilai tersebut dianggap sebagai observasi independen yang memiliki probabilitas <span class="math inline">\(\frac{1}{120}\)</span>. Sedangkan, kita ingin menguji apakah peluang masing-masing mata dadu muncul bernilai <span class="math inline">\(\frac{1}{6}\)</span>.</p>
Expand All @@ -474,7 +474,7 @@ <h3 class="anchored" data-anchor-id="menggunakan-statistik-uji">Menggunakan stat
<div class="cell-output cell-output-stdout">
<pre><code>dadu
1 2 3 4 5 6
19 20 20 22 21 18 </code></pre>
15 18 18 22 20 27 </code></pre>
</div>
</div>
<p>Maka, kita dapat melakukan uji chi-squared tanpa menggunakan fungsi chisq.test()</p>
Expand All @@ -488,7 +488,7 @@ <h3 class="anchored" data-anchor-id="menggunakan-statistik-uji">Menggunakan stat
<div class="cell-output cell-output-stdout">
<pre><code> [,1] [,2] [,3] [,4] [,5] [,6]
val.dadu "1" "2" "3" "4" "5" "6"
obs.dadu "19" "20" "20" "22" "21" "18"
obs.dadu "15" "18" "18" "22" "20" "27"
ex.dadu "20" "20" "20" "20" "20" "20"</code></pre>
</div>
</div>
Expand All @@ -503,7 +503,7 @@ <h3 class="anchored" data-anchor-id="menggunakan-statistik-uji">Menggunakan stat
<div class="sourceCode cell-code" id="cb33"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a>chi.hitung <span class="ot">&lt;-</span> <span class="fu">sum</span>((obs.dadu<span class="sc">-</span>ex.dadu)<span class="sc">**</span><span class="dv">2</span><span class="sc">/</span>ex.dadu)</span>
<span id="cb33-2"><a href="#cb33-2" aria-hidden="true" tabindex="-1"></a>chi.hitung</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 0.5</code></pre>
<pre><code>[1] 4.3</code></pre>
</div>
</div>
<p>dan <span class="math inline">\(\chi^2_{\alpha, k-1}\)</span></p>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/semuahalaman/modulprak/2024/ganjil/psd/psd2024.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="7" data-listing-date-sort="1732467600000" data-listing-file-modified-sort="1732515721498" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="9" data-listing-word-count-sort="1634">
<div class="g-col-1" data-index="7" data-listing-date-sort="1732467600000" data-listing-file-modified-sort="1732516031651" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="9" data-listing-word-count-sort="1634">
<a href="../../../../../semuahalaman/modulprak/2024/ganjil/psd/modul9.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="modul9_files\figure-html\unnamed-chunk-4-1.png" style="height: 150px;" class="thumbnail-image card-img"/></p>
<div class="card-body post-contents">
<h5 class="no-anchor card-title listing-title">
(Pertemuan 09) ANOVA dan Chi-Squared
(Pertemuan 09) ANOVA dan Uji Chi-Squared
</h5>
<div class="card-attribution card-text-small end">
<div class="listing-date">
Expand Down
2 changes: 1 addition & 1 deletion semuahalaman/modulprak/2024/ganjil/psd/modul8.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "(Pertemuan 8) Pengujian Hipotesis Menggunakan R"
title: "(Pertemuan 08) Pengujian Hipotesis Menggunakan R"
subtitle: "Hypothesis Testing in R"
description: "Offline di Departemen Matematika"
date: 11/18/2024
Expand Down

0 comments on commit 72901bd

Please sign in to comment.