Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 18282: Description of var.test for lm objects could be improved. #45

Open
shannonpileggi opened this issue Aug 9, 2024 · 0 comments
Labels
Documentation Issues in the documentation Hutch 2024 Issues reserved for R Dev Day @ Hutch 2024 needs patch Implement the agreed fix and prepare a patch for review

Comments

@shannonpileggi
Copy link

Bug 18282: Description of var.test for lm objects could be improved.

Initial submission below, see bugzilla for further documentation.

The Description of var.test reads (emphasis via * is mine):

The null hypothesis is that the ratio of the variances of the populations from which x and y were drawn, or in the data to which the linear models x and y were fitted, is equal to ratio.

The relevant part of the source code of var.test.default is:

if (inherits(x, "lm") && inherits(y, "lm")) {
DF.x <- x$df.residual
DF.y <- y$df.residual
V.x <- sum(x$residuals^2)/DF.x
V.y <- sum(y$residuals^2)/DF.y
}
ESTIMATE <- V.x/V.y
STATISTIC <- ESTIMATE/ratio
PARAMETER <- c(num df = DF.x, denom df = DF.y)
PVAL <- pf(STATISTIC, DF.x, DF.y)

(the default being ratio = 1)

I would suggest changing the emphasized part of the description to "or of the residual error terms of the data to which the linear models x and y were fitted".

I suggest this change because I believe it to be more comprehensive than "the variances in the data to which the linear models x and y were fitted".
@shannonpileggi shannonpileggi added Documentation Issues in the documentation needs patch Implement the agreed fix and prepare a patch for review Hutch 2024 Issues reserved for R Dev Day @ Hutch 2024 labels Aug 9, 2024
@hollyyfc hollyyfc assigned hollyyfc and unassigned hollyyfc Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues in the documentation Hutch 2024 Issues reserved for R Dev Day @ Hutch 2024 needs patch Implement the agreed fix and prepare a patch for review
Projects
None yet
Development

No branches or pull requests

2 participants