forked from vincentarelbundock/Rdatasets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerbAgg.html
109 lines (87 loc) · 3.85 KB
/
VerbAgg.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
<!DOCTYPE html><html><head><title>R: Verbal Aggression item responses</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">
<table style="width: 100%;"><tr><td>VerbAgg</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>Verbal Aggression item responses</h2>
<h3>Description</h3>
<p>These are the item responses to a questionaire on verbal
aggression. These data are used throughout De Boeck and
Wilson (2004) to illustrate various forms of item
response models.
</p>
<h3>Format</h3>
<p>A data frame with 7584 observations on the following 13 variables.
</p>
<dl>
<dt><code>Anger</code></dt><dd><p>the subject's Trait Anger score as measured on
the State-Trait Anger Expression Inventory (STAXI)</p>
</dd>
<dt><code>Gender</code></dt><dd><p>the subject's gender - a factor with levels
<code>M</code> and <code>F</code></p>
</dd>
<dt><code>item</code></dt><dd><p>the item on the questionaire, as a factor</p>
</dd>
<dt><code>resp</code></dt><dd><p>the subject's response to the item - an ordered
factor with levels <code>no</code> < <code>perhaps</code> < <code>yes</code></p>
</dd>
<dt><code>id</code></dt><dd><p>the subject identifier, as a factor</p>
</dd>
<dt><code>btype</code></dt><dd><p>behavior type - a factor with levels
<code>curse</code>, <code>scold</code> and <code>shout</code></p>
</dd>
<dt><code>situ</code></dt><dd><p>situation type - a factor with levels
<code>other</code> and <code>self</code> indicating other-to-blame and self-to-blame</p>
</dd>
<dt><code>mode</code></dt><dd><p>behavior mode - a factor with levels <code>want</code>
and <code>do</code></p>
</dd>
<dt><code>r2</code></dt><dd><p>dichotomous version of the response - a factor with
levels <code>N</code> and <code>Y</code></p>
</dd>
</dl>
<h3>Source</h3>
<p>Data available from the UC Berkeley BEAR Center at
<a href="https://old.bear.berkeley.edu/page/materials-explanatory-item-response-models">https://old.bear.berkeley.edu/page/materials-explanatory-item-response-models</a>
</p>
<h3>References</h3>
<p>De Boeck and Wilson (2004), <em>Explanatory Item
Response Models</em>, Springer.
</p>
<h3>Examples</h3>
<pre><code class='language-R'>str(VerbAgg)
## Show how r2 := h(resp) is defined:
with(VerbAgg, stopifnot( identical(r2, {
r <- factor(resp, ordered=FALSE); levels(r) <- c("N","Y","Y"); r})))
xtabs(~ item + resp, VerbAgg)
xtabs(~ btype + resp, VerbAgg)
round(100 * ftable(prop.table(xtabs(~ situ + mode + resp, VerbAgg), 1:2), 1))
person <- unique(subset(VerbAgg, select = c(id, Gender, Anger)))
require(lattice)
densityplot(~ Anger, person, groups = Gender, auto.key = list(columns = 2),
xlab = "Trait Anger score (STAXI)")
if(lme4:::testLevel() >= 3) { ## takes about 15 sec
print(fmVA <- glmer(r2 ~ (Anger + Gender + btype + situ)^2 +
(1|id) + (1|item), family = binomial, data =
VerbAgg), corr=FALSE)
} ## testLevel() >= 3
if (interactive()) {
## much faster but less accurate
print(fmVA0 <- glmer(r2 ~ (Anger + Gender + btype + situ)^2 +
(1|id) + (1|item), family = binomial,
data = VerbAgg, nAGQ=0L), corr=FALSE)
} ## interactive()
</code></pre>
</div>
</body></html>