Skip to content

Commit

Permalink
Merge branch 'release/2.5.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Feb 4, 2023
2 parents 0a3f469 + 06e50fe commit c6d60ea
Show file tree
Hide file tree
Showing 11 changed files with 270 additions and 294 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: supernova
Title: Judd, McClelland, & Ryan Formatting for ANOVA Output
Version: 2.5.3
Date: 2022-07-11
Version: 2.5.4
Date: 2022-07-28
Authors@R: c(
person("Adam", "Blake", , "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-7881-8652")),
Expand Down
97 changes: 43 additions & 54 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,49 @@
# supernova 2.5.3
# supernova 2.5.4

- Fix print error where `generate_models()` would only print the comparison models for type III SS.

* Remove references to `Fingers` data in examples and tests as it may be removed in the near future
* Fix issue where using a model fit with an interactive term that has `factor()` in it (e.g. `lm(mpg ~ factor(cyl) * hp, data = mtcars)`) would result in an incorrect *df* (and related values) in the ANOVA table.
# supernova 2.5.3

- Remove references to `Fingers` data in examples and tests as it may be removed in the near future
- Fix issue where using a model fit with an interactive term that has `factor()` in it (e.g. `lm(mpg ~ factor(cyl) * hp, data = mtcars)`) would result in an incorrect _df_ (and related values) in the ANOVA table.

# supernova 2.5.2

## Breaking (kind of)

* Deprecate `superanova()` as it was just an alias to `supernova()` (which was confusing for some students)

- Deprecate `superanova()` as it was just an alias to `supernova()` (which was confusing for some students)

# supernova 2.5.1

* Fix issue where models with long calls (i.e. `deparse(model$call)` results in a vector of length greater than 1) would break the functionality of `listwise_delete()`
* Change print method for `generate_models()` to look clean and comprehensible in Jupyter Notebooks.

- Fix issue where models with long calls (i.e. `deparse(model$call)` results in a vector of length greater than 1) would break the functionality of `listwise_delete()`
- Change print method for `generate_models()` to look clean and comprehensible in Jupyter Notebooks.

# supernova 2.5.0

* Change the order of the pairs when plotting `pairwise()` so that the plot matches the table.
* Fix bug where `pairwise()` would not recognize categorical variables if they were created by using
- Change the order of the pairs when plotting `pairwise()` so that the plot matches the table.
- Fix bug where `pairwise()` would not recognize categorical variables if they were created by using
`factor()` in the formula, e.g. `pairwise(lm(mpg ~ factor(cyl), data = mtcars))`.
* Fix printing in RMarkdown documents where `supernova()` output was interpreted as a table.
* Move `estimate-extraction` functions to [`coursekata`](https://github.com/UCLATALL/coursekata-r).
* **Breaking**: drop support for R 3.4

- Fix printing in RMarkdown documents where `supernova()` output was interpreted as a table.
- Move `estimate-extraction` functions to [`coursekata`](https://github.com/UCLATALL/coursekata-r).
- **Breaking**: drop support for R 3.4

# supernova 2.4.4

* Remove `supernova-vctrs` from exports

- Remove `supernova-vctrs` from exports

# supernova 2.4.3

* Fix issues with `lintr` causing `R CMD CHECK` to fail
* Change maintainer to [@adamblake](https://github.com/adamblake)
* Change mislabeled factor level in `Fingers$Interest` to "Very Interested"

- Fix issues with `lintr` causing `R CMD CHECK` to fail
- Change maintainer to [@adamblake](https://github.com/adamblake)
- Change mislabeled factor level in `Fingers$Interest` to "Very Interested"

# supernova 2.4.2

* Ensure appropriate version of `pillar` is available (thanks @cedricbatailler)

- Ensure appropriate version of `pillar` is available (thanks @cedricbatailler)

# supernova 2.4.1

* Small tweaks to make the package work on R 3.4.0

- Small tweaks to make the package work on R 3.4.0

# supernova 2.4.0

Expand All @@ -62,69 +58,62 @@ There are four new pairwise comparisons functions:

Each of these determines all the pairwise comparisons that can be made for a model (fit by `lm()`) and then computes the comparisons. For `pairwise_t()` no correction is made for multiple comparisons, but for the others, the named correction is made. These corrections can also be specified as arguments to the `pairwise()` wrapper function. Each function produces output that has customized printing, supports most (if not all) normal data frame actions, and a plotting function that graphs the mean differences and their confidence intervals.


# supernova 2.3.0

* Dependency on `lme4` is moved to Suggests. Models implementing `lmerMod` are handled via `supernova.lmerMod` and `variables.lmerMod` but use of the `lme4` package is limited to tests.
* More robust and readable implementation of `variables()` using the new formula utility functions added. See `?formula_building`, `?formula_expansion`, and `?formula_extraction`.
* Add a new function `equation()` to extract the fitted equation from a linear model (`lm()`) (thanks for the suggestion from [@ave-63](https://github.com/ave-63)!)

- Dependency on `lme4` is moved to Suggests. Models implementing `lmerMod` are handled via `supernova.lmerMod` and `variables.lmerMod` but use of the `lme4` package is limited to tests.
- More robust and readable implementation of `variables()` using the new formula utility functions added. See `?formula_building`, `?formula_expansion`, and `?formula_extraction`.
- Add a new function `equation()` to extract the fitted equation from a linear model (`lm()`) (thanks for the suggestion from [@ave-63](https://github.com/ave-63)!)

# supernova 2.2.3

* Remove dependency on `dplyr` because it changes too quickly and has too many other dependencies
* Mild refactoring to improve code readability

- Remove dependency on `dplyr` because it changes too quickly and has too many other dependencies
- Mild refactoring to improve code readability

# supernova 2.2.2

* Patch to keep up with changes to `lme4`

- Patch to keep up with changes to `lme4`

# supernova 2.2.1

* Add support for mixed models (as in nested and crossed). See the README for more information.

- Add support for mixed models (as in nested and crossed). See the README for more information.

# supernova 2.2.0

Extend supernova to handle within (crossed) designs

* Add `lme4` and `dplyr` to Imports
* Update R dependency to 3.5.0 (for serialized data; Rds)
* Convert `supernova` to S3 class with methods for `lm` and `lmerMod`
* Add tests for `supernova()` for crossed (but not nested) `lmer()` fits
* Extend `print.supernova` to handle new models
- Add `lme4` and `dplyr` to Imports
- Update R dependency to 3.5.0 (for serialized data; Rds)
- Convert `supernova` to S3 class with methods for `lm` and `lmerMod`
- Add tests for `supernova()` for crossed (but not nested) `lmer()` fits
- Extend `print.supernova` to handle new models

Minor changes:

* Refactor utility functions into utils.R
* Add internal documentation for utility functions

- Refactor utility functions into utils.R
- Add internal documentation for utility functions

# supernova 2.1.1

* Added a `NEWS.md` file to track changes to the package.
- Added a `NEWS.md` file to track changes to the package.

* Created and added a logo to the package. (#21, @adamblake)
- Created and added a logo to the package. (#21, @adamblake)

* Added the ability to change the type of sums of squares to calculate when computing the ANOVA tables. Users can choose from 1/I/sequential, 2/II/hierarchical, 3/III/orthogonal. (#22, @adamblake)
- Added the ability to change the type of sums of squares to calculate when computing the ANOVA tables. Users can choose from 1/I/sequential, 2/II/hierarchical, 3/III/orthogonal. (#22, @adamblake)

* Added pedagogical function `generate_models()` for showing which models are being compared when evaluating terms in a model. This function also supports specification of the type of sums of squares to use. (#22, @adamblake)
- Added pedagogical function `generate_models()` for showing which models are being compared when evaluating terms in a model. This function also supports specification of the type of sums of squares to use. (#22, @adamblake)

* Updated the README to be generated from an Rmd file and to include information and examples regarding how to calculate different SS types and how to use `generate_models()`
- Updated the README to be generated from an Rmd file and to include information and examples regarding how to calculate different SS types and how to use `generate_models()`

* Added a data frame identical to Servers named Tables. This is a more appropriate name for the dataset because each row describes what happened at a table in the restaurant.
- Added a data frame identical to Servers named Tables. This is a more appropriate name for the dataset because each row describes what happened at a table in the restaurant.
- Updated variable names and documentation to "table" as well.
- Added deprecation notice to Servers documentation as the table will be removed in the future.


# supernova 2.0.0

* Added support for multiple regression using Type III sums of squares
- Added support for multiple regression using Type III sums of squares

* Updated README for more information, examples, and a description of how the calculation of the ANOVA tables follows the model comparison approach used in Judd, McClelland, & Ryan (2017).
- Updated README for more information, examples, and a description of how the calculation of the ANOVA tables follows the model comparison approach used in Judd, McClelland, & Ryan (2017).

# supernova 1.1.0

This version of supernova is the original distributed on CRAN. Calculation of supernova() tables with *multiple* predictor variables in this version will not produce output similar to the reference text, Judd, McClelland, and Ryan. However, the values for *single* predictor models are correct.
This version of supernova is the original distributed on CRAN. Calculation of supernova() tables with _multiple_ predictor variables in this version will not produce output similar to the reference text, Judd, McClelland, and Ryan. However, the values for _single_ predictor models are correct.
2 changes: 1 addition & 1 deletion R/generate_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ drop_term <- function(fit, term) {
#' @export
print.comparison_models <- function(x, ...) {
full_model <- attr(x, "model")
x <- generate_models.formula(as.formula(full_model))
x <- generate_models.formula(as.formula(full_model), attr(x, "type"))

if (vctrs::vec_is_empty(x)) {
cli::cli_alert("No comparisons for empty model.")
Expand Down
3 changes: 2 additions & 1 deletion R/supernova.R
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ print.supernova <- function(x, pcut = 4, ...) {
tbl <- lapply(tbl, function(x) gsub("\\s*NA\\s*", " ", x)) %>%
as.data.frame(stringsAsFactors = FALSE)

# trim leading 0 from p
# trim leading 0 from p and PRE
tbl[["p"]] <- substring(tbl[["p"]], 2)
tbl[["PRE"]] <- substring(tbl[["PRE"]], 2)

# TABLE FORMATTING
# add placeholders for null model
Expand Down
16 changes: 7 additions & 9 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
## Release summary

* Fix issue where using a model fit with an interactive term that has `factor()`
in it (e.g. `lm(mpg ~ factor(cyl) * hp, data = mtcars)`) would result in an
incorrect *df* (and related values) in the ANOVA table.
- Fix print error where `generate_models()` would only print the comparison models for type III SS.

## Test environments

- Local install on macOS Monterey 12.4 (ARM); R 4.2.1
- Local install on macOS Monterey 12.5 (ARM); R 4.2.1
- GitHub Actions
* macOS, 11.6.6; R 4.2.1
* Microsoft Windows Server 2022, 10.0.20348; R 4.2.1
* Ubuntu, 20.04; R-devel, R 4.2.1

- macOS, 11.6.8; R 4.2.1
- Microsoft Windows Server 2022, 10.0.20348; R 4.2.1
- Ubuntu, 20.04.4; R-devel, R 4.2.1
- `check_rhub()`
- `check_win_devel()`

## R CMD check results

0 errors v | 0 warnings v | 0 notes v

R CMD check succeeded


## Reverse dependencies

No known reverse dependencies (no results from `devtools::revdep('supernova')`)
72 changes: 36 additions & 36 deletions tests/testthat/_snaps/generate_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
generate_models(test_formula, type = 1)
Output
-- Comparison Models for Type III SS -------------------------------------------
-- Comparison Models for Type I SS ---------------------------------------------
-- Full Model
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ NULL
-- a
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ b + c + a:b + a:c + b:c + a:b:c
complex: y ~ a
simple: y ~ NULL
-- b
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + c + a:b + a:c + b:c + a:b:c
complex: y ~ a + b
simple: y ~ a
-- c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + a:b + a:c + b:c + a:b:c
complex: y ~ a + b + c
simple: y ~ a + b
-- a:b
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + c + a:c + b:c + a:b:c
complex: y ~ a + b + c + a:b
simple: y ~ a + b + c
-- a:c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + c + a:b + b:c + a:b:c
complex: y ~ a + b + c + a:b + a:c
simple: y ~ a + b + c + a:b
-- b:c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + c + a:b + a:c + a:b:c
complex: y ~ a + b + c + a:b + a:c + b:c
simple: y ~ a + b + c + a:b + a:c
-- a:b:c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
Expand All @@ -45,35 +45,35 @@
generate_models(test_formula, type = 2)
Output
-- Comparison Models for Type III SS -------------------------------------------
-- Comparison Models for Type II SS --------------------------------------------
-- Full Model
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ NULL
-- a
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ b + c + a:b + a:c + b:c + a:b:c
complex: y ~ a + b + c + b:c
simple: y ~ b + c + b:c
-- b
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + c + a:b + a:c + b:c + a:b:c
complex: y ~ a + b + c + a:c
simple: y ~ a + c + a:c
-- c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + a:b + a:c + b:c + a:b:c
complex: y ~ a + b + c + a:b
simple: y ~ a + b + a:b
-- a:b
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + c + a:c + b:c + a:b:c
complex: y ~ a + b + c + a:b + a:c + b:c
simple: y ~ a + b + c + a:c + b:c
-- a:c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + c + a:b + b:c + a:b:c
complex: y ~ a + b + c + a:b + a:c + b:c
simple: y ~ a + b + c + a:b + b:c
-- b:c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
simple: y ~ a + b + c + a:b + a:c + a:b:c
complex: y ~ a + b + c + a:b + a:c + b:c
simple: y ~ a + b + c + a:b + a:c
-- a:b:c
complex: y ~ a + b + c + a:b + a:c + b:c + a:b:c
Expand Down Expand Up @@ -127,19 +127,19 @@
generate_models(test_lm, type = 1)
Output
-- Comparison Models for Type III SS -------------------------------------------
-- Comparison Models for Type I SS ---------------------------------------------
-- Full Model
complex: mpg ~ hp + disp + hp:disp
simple: mpg ~ NULL
-- hp
complex: mpg ~ hp + disp + hp:disp
simple: mpg ~ disp + hp:disp
complex: mpg ~ hp
simple: mpg ~ NULL
-- disp
complex: mpg ~ hp + disp + hp:disp
simple: mpg ~ hp + hp:disp
complex: mpg ~ hp + disp
simple: mpg ~ hp
-- hp:disp
complex: mpg ~ hp + disp + hp:disp
Expand All @@ -152,19 +152,19 @@
generate_models(test_lm, type = 2)
Output
-- Comparison Models for Type III SS -------------------------------------------
-- Comparison Models for Type II SS --------------------------------------------
-- Full Model
complex: mpg ~ hp + disp + hp:disp
simple: mpg ~ NULL
-- hp
complex: mpg ~ hp + disp + hp:disp
simple: mpg ~ disp + hp:disp
complex: mpg ~ hp + disp
simple: mpg ~ disp
-- disp
complex: mpg ~ hp + disp + hp:disp
simple: mpg ~ hp + hp:disp
complex: mpg ~ hp + disp
simple: mpg ~ hp
-- hp:disp
complex: mpg ~ hp + disp + hp:disp
Expand Down
Loading

0 comments on commit c6d60ea

Please sign in to comment.