Skip to content

woolf_twoway(), color_table() fixes, term-level loglm tests

Latest

Choose a tag to compare

@friendly friendly released this 18 Nov 14:18

This release, submitted to CRAN as vcdExtra 0.9.9, collects all changes since the last GitHub release (v0.9.3), including the 0.9.7 CRAN release.

Version 0.9.9

  • color_table() with model = put the residuals into the wrong cells of multi-way tables
    with more than one row or column variable, because they were reshaped in the order of the
    original array rather than the displayed layout. Residuals are now matched to cells by
    factor names, for loglm and glm models, and for table, structable and ftable
    input; a model whose factors don't match the table now gives an error.

  • color_table()'s expected = now also accepts an array over the table's factors (in any
    order of dimensions), not only a matrix in the flattened layout.

  • color_table() now reports its shading note with message() instead of cat(), so it can
    be silenced with suppressMessages() or message: false, and only when the note is not
    already shown in the table (legend = FALSE). The "Re-fitting to get frequencies and fitted
    values" line from its internal independence model no longer appears.

  • logist_plot() and its convenience wrappers now use the eight distinct colours of the
    Okabe-Ito palette by default. Plots with more than eight observed groups must supply
    group.colors.

  • woolf_test() now returns LOR and LOR_se, the per-stratum log odds ratio and its
    standard error, shaped as an array over the stratifying dimensions (e.g., an R x C matrix
    for a 4-way table) rather than a flat vector, with dimnames carried over from the input.
    This avoids having to recompute them from scratch for further analysis of the log odds
    ratios.

  • Added woolf_twoway(), which decomposes the stratum log odds ratios of a
    2 x 2 x R x C table into additive row and column effects, following Tukey's two-way fit
    as implemented by the twoway package. Since twoway::twoway() has no weight argument,
    woolf_twoway() fits the additive model directly by weighted least squares using the same
    Woolf inverse-variance weights as woolf_test() (weighted = TRUE, the default), or via
    twoway::twoway() directly for the ordinary unweighted mean-polish (weighted = FALSE).
    The result is an object of class "twoway", so twoway's own print()/plot() methods
    (which = "fit" or "diagnose") work on it unchanged.

  • Links to papers formerly hosted at datavis.ca now point to https://friendly.github.io/papers/
    or to DOIs.

Version 0.9.8

This is a significant release, with a number of new features, notably plotting
logistic regression models with display of marginal distributions of x,
and term-level tests for loglinear models.

  • Summarise() is now formally deprecated (.Deprecated("LRstats")), in
    favor of LRstats(), which provides the same brief model-fit comparison.
    Summarise()'s capitalized name reads as an easy-to-mistype near-collision
    with dplyr::summarise(), which vcdExtra also imports internally; LRstats()
    has been the recommended replacement since 0.6-5 but was never actually
    wired up to warn. See ?vcdExtra-deprecated.

  • Added logist_plot() for plotting a glm(y ~ x, family = binomial) fit for a single
    quantitative predictor together with a representation of the marginal distribution of x
    within each response group -- mirrored histograms, filled density estimates, or jittered
    points -- as suggested by Smart et al. (2004). Supports vector, data frame, and formula
    calling conventions; an optional group= for grouped fits and marginals with per-group
    colours; and fit.args=/marginal.args=/marginal.height= for layer-level customization
    beyond the fit.color=/marginal.color= convenience arguments. logist_hist(),
    logist_point(), and logist_density() are convenience wrappers with marginal= fixed to
    "hist"/"points"/"density". Work by Gavin Klorfine.

  • Fixed bug in CMHtest3() (the internal overall = TRUE helper) which
    suppressed Df and Prob (p-value) for the overall population results
    whenever types was not the full default set of four (#2, reported by
    @bill-raynor and @imazubi; fix by @danielinteractive in #26).

  • Added drop1.loglm(), LRanova(), and assoc_strength() for term-level analysis of loglm
    models. drop1.loglm() (registered as an S3 method for stats::drop1(), and also directly
    callable by name) performs single-term deletion tests for a model's generating class, refitting
    via update() and reporting both LR (G^2) and Pearson (X^2) statistics per term.

  • LRanova() wraps it with a partial R^2 effect-size column relative to a (nesting-checked)
    baseline model.

  • assoc_strength() wraps it with a partial Cramer's V / Cohen's w
    effect-size column, generalized to terms of any order. The fitted models underlying each test
    are attached as a loglmlist (attr(., "models")), reusable directly with mosaic(),
    LRstats(), and get_models() without refitting.

Version 0.9.7

This is a significant release, with a number of new features

  • color_table() now displays multiple row variables as separate stub columns (e.g. "Class",
    "Sex") instead of concatenated labels like "1st_Male", using gt's multi-column stub support.
    Mirrors the existing column-spanner display for multiple column variables, and the two can be
    combined in the same table.
  • Added more worked examples to the Mental dataset documentation
  • General package clean-up: removed stale pre-roxygen and superseded dev/extra files, and
    reorganized color_table()/assoc_graph() development notes into their own subfolders
  • Now reference new work on tidy methods (as_*() methods, collapse_levels(), ...) in the tidyCats vignette
  • Added breslow_day_test() for the Breslow-Day test of homogeneity of odds ratios across strata
    in 2x2xk tables, generalized to handle tables of any dimensionality, with an optional Tarone
    correction and a decompose option (for 2x2xRxC tables) giving a woolf_test()-style
    row/column/residual decomposition of the overall test
  • Added a layout = "2x2" display option to print.CMHtest(), reorganizing the four CMH statistics
    (cor, rmeans, cmeans, general) into a 2x2 table crossing how the row and column variables are
    each treated (general/nominal vs. ordered/scored). Falls back to the existing flat table
    display, with a warning, when not all four statistics are available

Version 0.9.6

This is a cumulative release of a number of small enhancements to the package since the last CRAN version

  • Fix @Aliases for roxygen 8.0.0
  • Make some color_table() examples visible in documentation

Version 0.9.5

This is a major release of the package, completing work on a sizable collection of tidy tools
for manipulating categorical data in various forms

  • Added a general collapse_levels() function that can collapse levels of variables belonging to data sets of any form. [GK]
  • Added as_matrix() to the set of as_*() conversion functions. [GK]
  • Added prop arguments to applicable as_*() conversion functions to easily convert counts to proportions (either relative
    to the grand total count or to specified margins). [GK]
  • Added vignette on tidy operations (convert, collapsing) [GK]
  • Gavin Klorfine (@gklorfine) becomes a package author

Version 0.9.4

  • suppressWarnings() from ca:mcja() in mcaplot() examples