You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* a [collection of tutorial vignettes](https://cran.r-project.org/web/packages/vcdExtra/vignettes/). In the installed package, they can be viewed using `browseVignettes(package = "vcdExtra")`;
* A re-implementation of `vcd::woolf_test()` extends the analysis of homogeneity of odds ratios
153
+
in 2 x 2 x R x C tables to provide tests for differences among the R strata rows and C strata columns.
154
+
155
+
145
156
146
157
147
158
## Examples
148
159
149
-
These `README` examples simply provide illustrations of using some of the package functions in the
160
+
These `README` examples provide simple illustrations of using some of the package functions in the
150
161
context of loglinear models for frequency tables fit using `glm()`, including
151
162
models for _structured associations_ taking ordinality into account.
152
163
153
-
The dataset `Mental` is a data frame frequency table representing the cross-classification of mental health status (`mental`) of 1660 young New York residents by their parents' socioeconomic status (`ses`).
154
-
Both are _ordered_ factors.
164
+
### `Mental` dataset
165
+
The dataset `vcdExtra::Mental` is a data frame frequency table representing the cross-classification of mental health status (`mental`) of 1660 young New York residents by their parents' socioeconomic status (`ses`).
166
+
Both are _ordered_ factors. The questions are:
167
+
* Is `mental` health associated with parents `ses`?
168
+
* If so, what is the pattern/nature of the association?
169
+
* How can I take the ordinal nature of the factors into account?
155
170
156
171
```{r ex-mental1}
157
172
data(Mental)
@@ -212,6 +227,11 @@ These models typically use equally spaced _integer_ scores.
212
227
The test for association here is analogous to a test of the correlation
213
228
between the frequency-weighted scores, carried out using `CMHtest()`.
214
229
230
+
```{r}
231
+
CMHtest(Mental.tab)
232
+
```
233
+
234
+
215
235
In the data, `ses` and `mental` were declared to be ordered factors,
216
236
so using `as.numeric(Mental$ses)` is sufficient to create a new `Cscore`
217
237
variable. Similarly for the numeric version of `mental`, giving `Rscore`.
Copy file name to clipboardExpand all lines: vignettes/tidyCats.Rmd
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ expand.dft(hec.df) |> head()
76
76
```
77
77
78
78
79
-
*`vcd::structable()` (and `stats::ftable()`) produce a ‘flat’ representation of a high-dimensional contingency table constructed by recursive splits (similar to the construction of mosaic displays). One can be constructed from a table or from a data frame with
79
+
*`vcd::structable()` (and `stats::ftable()`) produce a 'flat' representation of a high-dimensional contingency table constructed by recursive splits (similar to the construction of mosaic displays). One can be constructed from a table or from a data frame with
0 commit comments