forked from vincentarelbundock/Rdatasets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDyke.html
138 lines (106 loc) · 4.2 KB
/
Dyke.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
<!DOCTYPE html><html><head><title>R: Sources of Knowledge of Cancer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<script type="text/javascript">
const macros = { "\\R": "\\textsf{R}", "\\code": "\\texttt"};
function processMathHTML() {
var l = document.getElementsByClassName('reqn');
for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }
return;
}</script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
onload="processMathHTML();"></script>
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body><div class="container"><main>
<table style="width: 100%;"><tr><td>Dyke</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>Sources of Knowledge of Cancer</h2>
<h3>Description</h3>
<p>Observational data on a sample of 1729 individuals, cross-classified in a 2^5 table according to their sources of
information (read newspapers, listen to the radio, do 'solid' reading, attend lectures) and whether they have
good or poor knowledge regarding cancer. Knowledge of cancer is often treated as the response.</p>
<h3>Usage</h3>
<pre><code class='language-R'>data(Dyke)</code></pre>
<h3>Format</h3>
<p>A 5-dimensional array resulting from cross-tabulating 5 variables for 1729 observations. The variable names and their levels are:
</p>
<table>
<tr>
<td style="text-align: right;">
No </td><td style="text-align: left;"> Name </td><td style="text-align: left;"> Levels </td>
</tr>
<tr>
<td style="text-align: right;">
1</td><td style="text-align: left;"> <code>Knowledge</code></td><td style="text-align: left;"> <code>"Good", "Poor"</code></td>
</tr>
<tr>
<td style="text-align: right;">
2</td><td style="text-align: left;"> <code>Reading</code></td><td style="text-align: left;"> <code>"No", "Yes"</code></td>
</tr>
<tr>
<td style="text-align: right;">
3</td><td style="text-align: left;"> <code>Radio</code></td><td style="text-align: left;"> <code>"No", "Yes"</code></td>
</tr>
<tr>
<td style="text-align: right;">
4</td><td style="text-align: left;"> <code>Lectures</code></td><td style="text-align: left;"> <code>"No", "Yes"</code></td>
</tr>
<tr>
<td style="text-align: right;">
5</td><td style="text-align: left;"> <code>Newspaper</code></td><td style="text-align: left;"> <code>"No", "Yes"</code></td>
</tr>
<tr>
<td style="text-align: right;">
</td>
</tr>
</table>
<h3>Source</h3>
<p>Fienberg, S. E. (1980).
<em>The Analysis of Cross-Classified Categorical Data</em>
Cambridge, MA: MIT Press, p. 85, Table 5-6.
</p>
<h3>References</h3>
<p>Dyke, G. V. and Patterson, H. D. (1952).
Analysis of factorial arrangements when the data are proportions.
<em>Biometrics</em>, 8, 1-12.
</p>
<p>Lindsey, J. K. (1993).
<em>Models for Repeated Measurements</em>
Oxford, UK: Oxford University Press, p. 57.
</p>
<h3>Examples</h3>
<pre><code class='language-R'>data(Dyke)
# independence model
mosaic(Dyke, shade=TRUE)
# null model, Knowledge as response, independent of others
require(MASS)
dyke.mod0 <- loglm(~ Knowledge + (Reading * Radio * Lectures * Newspaper), data=Dyke)
dyke.mod0
mosaic(dyke.mod0)
# view as doubledecker plot
Dyke <- Dyke[2:1,,,,] # make Good the highlighted value of Knowledge
doubledecker(Knowledge ~ ., data=Dyke)
# better version, with some options
doubledecker(Knowledge ~ Lectures + Reading + Newspaper + Radio,
data=Dyke,
margins = c(1,6, length(dim(Dyke)) + 1, 1),
fill_boxes=list(rep(c("white", gray(.90)),4))
)
# separate (conditional) plots for those who attend lectures and those who do not
doubledecker(Knowledge ~ Reading + Newspaper + Radio,
data=Dyke[,,,1,],
main="Do not attend lectures",
margins = c(1,6, length(dim(Dyke)) + 1, 1),
fill_boxes=list(rep(c("white", gray(.90)),3))
)
doubledecker(Knowledge ~ Reading + Newspaper + Radio,
data=Dyke[,,,2,],
main="Attend lectures",
margins = c(1,6, length(dim(Dyke)) + 1, 1),
fill_boxes=list(rep(c("white", gray(.90)),3))
)
drop1(dyke.mod0, test="Chisq")
</code></pre>
</main>
</div>
</body></html>