adding proportions table (and hopefully nothing else)
This commit is contained in:
@@ -1617,6 +1617,12 @@ obama.tbl</code></pre>
|
|||||||
## took_fruit FALSE TRUE
|
## took_fruit FALSE TRUE
|
||||||
## FALSE 593 322
|
## FALSE 593 322
|
||||||
## TRUE 185 122</code></pre>
|
## TRUE 185 122</code></pre>
|
||||||
|
<pre class="r"><code>obama.prop.tbl <- proportions(table(took_fruit = df$fruit, saw_flotus = df$obama), margin = 2)
|
||||||
|
obama.prop.tbl</code></pre>
|
||||||
|
<pre><code>## saw_flotus
|
||||||
|
## took_fruit FALSE TRUE
|
||||||
|
## FALSE 0.7622108 0.7252252
|
||||||
|
## TRUE 0.2377892 0.2747748</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<div id="pc4.-test-for-differences-between-groups" class="section level2">
|
<div id="pc4.-test-for-differences-between-groups" class="section level2">
|
||||||
<h2>PC4. Test for differences between groups</h2>
|
<h2>PC4. Test for differences between groups</h2>
|
||||||
@@ -1736,7 +1742,7 @@ p1</code></pre>
|
|||||||
<pre class="r"><code>library(xtable)
|
<pre class="r"><code>library(xtable)
|
||||||
print(xtable(obama.tbl), type = "html")</code></pre>
|
print(xtable(obama.tbl), type = "html")</code></pre>
|
||||||
<pre><code>## <!-- html table generated in R 4.0.3 by xtable 1.8-4 package -->
|
<pre><code>## <!-- html table generated in R 4.0.3 by xtable 1.8-4 package -->
|
||||||
## <!-- Mon Oct 26 11:16:05 2020 -->
|
## <!-- Tue Oct 27 20:25:44 2020 -->
|
||||||
## <table border=1>
|
## <table border=1>
|
||||||
## <tr> <th> </th> <th> FALSE </th> <th> TRUE </th> </tr>
|
## <tr> <th> </th> <th> FALSE </th> <th> TRUE </th> </tr>
|
||||||
## <tr> <td align="right"> FALSE </td> <td align="right"> 593 </td> <td align="right"> 322 </td> </tr>
|
## <tr> <td align="right"> FALSE </td> <td align="right"> 593 </td> <td align="right"> 322 </td> </tr>
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ summary(df)
|
|||||||
obama.tbl <- table(took_fruit=df$fruit, saw_flotus=df$obama)
|
obama.tbl <- table(took_fruit=df$fruit, saw_flotus=df$obama)
|
||||||
obama.tbl
|
obama.tbl
|
||||||
|
|
||||||
|
obama.prop.tbl <- proportions(table(took_fruit=df$fruit, saw_flotus=df$obama), margin=2)
|
||||||
|
obama.prop.tbl
|
||||||
```
|
```
|
||||||
|
|
||||||
## PC4. Test for differences between groups
|
## PC4. Test for differences between groups
|
||||||
|
|||||||
Reference in New Issue
Block a user