Skip to content

Commit 6dd8b5e

Browse files
bprice2652cran-robot
authored andcommitted
version 3.1-5
1 parent 3bee3ed commit 6dd8b5e

File tree

13 files changed

+94
-1481
lines changed

13 files changed

+94
-1481
lines changed

DESCRIPTION

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Package: car
2-
Version: 3.1-3
3-
Date: 2024-09-23
2+
Version: 3.1-5
3+
Date: 2026-01-05
44
Title: Companion to Applied Regression
5-
Authors@R: c(person("John", "Fox", role = c("aut", "cre"), email = "jfox@mcmaster.ca"),
5+
Authors@R: c(person("John", "Fox", role ="aut" , email = "jfox@mcmaster.ca"),
66
person("Sanford", "Weisberg", role = "aut", email = "sandy@umn.edu"),
7-
person("Brad", "Price", role = "aut", email = "brad.price@mail.wvu.edu"),
7+
person("Brad", "Price", role = c("aut", "cre"), email = "brad.price@mail.wvu.edu"),
88
person("Daniel", "Adler", role="ctb"),
99
person("Douglas", "Bates", role = "ctb"),
1010
person("Gabriel", "Baud-Bovy", role = "ctb"),
@@ -22,6 +22,7 @@ Authors@R: c(person("John", "Fox", role = c("aut", "cre"), email = "jfox@mcmaste
2222
person("Duncan", "Murdoch", role="ctb"),
2323
person("Henric", "Nilsson", role = "ctb"),
2424
person("Derek", "Ogle", role = "ctb"),
25+
person("Iain", "Proctor", role = "ctb"),
2526
person("Brian", "Ripley", role = "ctb"),
2627
person("Tom", "Short", role="ctb"),
2728
person("William", "Venables", role = "ctb"),
@@ -42,15 +43,15 @@ Description:
4243
Functions to Accompany J. Fox and S. Weisberg,
4344
An R Companion to Applied Regression, Third Edition, Sage, 2019.
4445
License: GPL (>= 2)
45-
URL: https://r-forge.r-project.org/projects/car/,
46+
URL: https://github.com/bprice2652/car_repo,
4647
https://CRAN.R-project.org/package=car,
47-
https://www.john-fox.ca/Companion/index.html
48+
https://z.umn.edu/carbook
4849
VignetteBuilder: knitr
4950
NeedsCompilation: no
50-
Packaged: 2024-09-24 21:10:57 UTC; johnfox
51-
Author: John Fox [aut, cre],
51+
Packaged: 2026-01-30 16:26:34 UTC; user
52+
Author: John Fox [aut],
5253
Sanford Weisberg [aut],
53-
Brad Price [aut],
54+
Brad Price [aut, cre],
5455
Daniel Adler [ctb],
5556
Douglas Bates [ctb],
5657
Gabriel Baud-Bovy [ctb],
@@ -68,13 +69,14 @@ Author: John Fox [aut, cre],
6869
Duncan Murdoch [ctb],
6970
Henric Nilsson [ctb],
7071
Derek Ogle [ctb],
72+
Iain Proctor [ctb],
7173
Brian Ripley [ctb],
7274
Tom Short [ctb],
7375
William Venables [ctb],
7476
Steve Walker [ctb],
7577
David Winsemius [ctb],
7678
Achim Zeileis [ctb],
7779
R-Core [ctb]
78-
Maintainer: John Fox <jfox@mcmaster.ca>
80+
Maintainer: Brad Price <brad.price@mail.wvu.edu>
7981
Repository: CRAN
80-
Date/Publication: 2024-09-27 05:10:03 UTC
82+
Date/Publication: 2026-02-03 10:10:16 UTC

MD5

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ac9cb3faa766879f57237a7d97e6a566 *DESCRIPTION
1+
23031723516bb51420b200d15a32a826 *DESCRIPTION
22
cb7b2142d1df1ace0872f1a969b4cefe *NAMESPACE
3-
f562aa3ef4b8918b5459b9e959da71af *NEWS
3+
e2abd67018dbda1b6f4acccb686f8d3c *NEWS
44
c1d1b72104d471db72175aad1f59e884 *R/Anova.R
55
3effd70a639a7336269f94a285d12807 *R/Boot.R
66
923a00fbf64c35abc42805ed43f4e974 *R/Boxplot.R
@@ -15,20 +15,20 @@ b96660140a0ac2e9a959fc8789d28c6f *R/S.R
1515
fd9c68f0e4ea9d60b3bc63ba9b11303b *R/adaptiveKernel.R
1616
0b752641a12bbeaad710854c4649a6de *R/avPlot3d.R
1717
69e5d0c221a654e5cc5d5d4bd2ced2b2 *R/avPlots.R
18-
2da153aefab121e4b8c7f060187b49b0 *R/bcnPower.R
18+
d31c4d52236b3dae0d031a6c7604a3f5 *R/bcnPower.R
1919
02ca2cad443a9b66dd49da2754e11d27 *R/boxCox.R
2020
e999330432693c1369b1fb5e2ed7b116 *R/boxCoxVariable.R
2121
9e7e873b105e6a817d913c7646263fa8 *R/boxTidwell.R
2222
4cac526e0c83f3c82f6465a50193058e *R/brief.R
2323
b420d3bdc47fb62ea2f33c1829533467 *R/car-defunct.R
2424
ebcac6f262a26c74e59229ee1e30e7bc *R/car-deprecated.R
2525
c6347c4eeef0dadeeb5c88ad9608dcf9 *R/carHexsticker.R
26-
c904f1ed845822c07ab8b51b9a35785e *R/carWeb.R
26+
73bbdacc3d65572e79db49d795cc02e1 *R/carWeb.R
2727
3ed6b97ba60b4749edf08d428b022c71 *R/ceresPlots.R
2828
320f846a1788e0b8ce19294a3d7238c1 *R/compareCoefs.R
2929
b5a8db87788288da4b3840f17da5aa5f *R/crPlot3d.R
3030
7651a03e222fbdccc9822d1aabe54301 *R/crPlots.R
31-
52bce29501aa7ebad6ce9996902019b6 *R/deltaMethod.R
31+
222b55fa07043e100e4d80eb88fb42f1 *R/deltaMethod.R
3232
5d4c4d78b963e1f598648246498f0d49 *R/densityPlot.R
3333
cb88c6ed6b7df0507502578ba8faa887 *R/dfbetaPlots.R
3434
a89ec78a4487110c5315c4d204517067 *R/durbinWatsonTest.R
@@ -41,7 +41,7 @@ b2e49aeed279384dce3552ca8e73d7ea *R/influence-mixed-models.R
4141
07425429472a206c91e9a5f04553387a *R/leveneTest.R
4242
700a0277e64df33187ebb94da9e0d690 *R/leveragePlots.R
4343
295788efad0a5fe4064a9c63a400fe9e *R/linearHypothesis.R
44-
19223950b37d451f884a90c17812acc9 *R/logit.R
44+
22b85558621da2385027f8e567e2e7b5 *R/logit.R
4545
afdf9ac6fc5284816b8e686cc7339fc5 *R/marginalModelPlot.R
4646
73d8f74a5019b754e13958b09b5fcd9f *R/mcPlots.R
4747
f62cbd8dff1b0076b0554d58a1455cba *R/ncvTest.R
@@ -70,11 +70,11 @@ ca1db5bd7603b2dfd01560e4d734e20b *R/utility-functions.R
7070
83bda9ab7ba16181575b0ce78e40205c *R/vif.R
7171
317b9f576ec59708c8945d1f8126c5fa *R/wcrossprod.R
7272
d90296231464288e04124e8f1d864302 *R/which.names.R
73-
e5007d39bc363fac603929a6c237937f *build/vignette.rds
73+
e21a8084bd8becb64715205fd7eca20c *build/vignette.rds
7474
fcd1b87b45ce9e264116db4a8b3db17e *inst/CITATION
7575
7621f84dece1418b1687ca3516d1bdf8 *inst/doc/embedding.R
7676
984ec51291df672146d63264a1d3b428 *inst/doc/embedding.Rnw
77-
9c015325d0bfebec5f086789b44f07a2 *inst/doc/embedding.pdf
77+
9772724d86a8085c1bcc32755809a459 *inst/doc/embedding.pdf
7878
b6b5c8008a809152b9308aba25757693 *inst/misc/car-hex.pdf
7979
8ab7697c92ac8b3cfcca210e51816c5d *man/Anova.Rd
8080
b49a55db15e8541075667e42bfdd2bca *man/Boot.Rd
@@ -103,21 +103,21 @@ d1149daa100a5471a5da3308742ccb66 *man/carWeb.Rd
103103
a130c7d676ee3954d1dead941398265d *man/ceresPlots.Rd
104104
419d84f7f8de1df01f6a4179170f5ec4 *man/compareCoefs.Rd
105105
1ebe0d20258d03daf8fde23c29d01297 *man/crPlots.Rd
106-
b57db3161fe91747668c2a57cdf5f246 *man/deltaMethod.Rd
106+
3afb63f3c0fbdff345414e162c747ee6 *man/deltaMethod.Rd
107107
a96436d9a0ec006374d431e9aa294b52 *man/densityPlot.Rd
108108
3e5c68e5f118aa2a0abae358afd1bca5 *man/dfbetaPlots.Rd
109109
90958fada247ed72d05247db2a5f7a24 *man/durbinWatsonTest.Rd
110110
a350c13d5e2e4ac206a9dbdeb9959369 *man/hccm.Rd
111111
a96098e7b713736418f1836267f649c2 *man/hist.boot.Rd
112112
9c03608405b5c26070c02c4cc1842a96 *man/infIndexPlot.Rd
113-
06ab32baa0f85d48535f51ef87691ddf *man/influence-mixed-models.Rd
113+
be8cc40c2e26a2838c2be4b8ab1fea53 *man/influence-mixed-models.Rd
114114
851d732bc183c797f9e7c8f4951fc424 *man/influencePlot.Rd
115115
eca15590f3162495bef3432ffb08e631 *man/invResPlot.Rd
116116
3f76990cbc8e9035c1cefd424cd1598a *man/invTranPlot.Rd
117117
0b5bf989bf429ac840eeda6941b3eb30 *man/leveneTest.Rd
118118
ccc93db837fab1926b25f3f9aca649e1 *man/leveragePlots.Rd
119119
6cd7a00c0f6fec3055a8bbbba6940674 *man/linearHypothesis.Rd
120-
395cb504354ffb14de629bd7c9f5a49a *man/logit.Rd
120+
b7082349e0b5cc4aa4c16820064cfc10 *man/logit.Rd
121121
65d2d45982cbccb2232303cac88565f9 *man/marginalModelPlot.Rd
122122
40b54b5201001390eefb5252a4e7b0b9 *man/mcPlots.Rd
123123
1741d4d0f16ae9204e5d2e066fcd1f05 *man/ncvTest.Rd
@@ -146,4 +146,3 @@ bf7bfec1ac893d88695326b83c934488 *man/vif.Rd
146146
a2457d852921c189e67e950b6b97390a *man/which.names.Rd
147147
984ec51291df672146d63264a1d3b428 *vignettes/embedding.Rnw
148148
890d5ff5fd904c2eff8b3c3fb277fd10 *vignettes/embedding.bib
149-
ffe5423d2019860bad9f54bc402fac15 *vignettes/plainnat.bst

NEWS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Changes to Version 3.1-5
2+
3+
o New maintainer and updated information
4+
5+
Changes to Version 3.1-5
6+
7+
o New maintainer and updated information
8+
9+
10+
Changes to Version 3.1-4
11+
12+
o Fixed bugs in powerTransformation using the bcnPower family. New results may differ slightly from former results.
13+
14+
o Fix bug in logit() (reported and fixed by Iain Proctor)
15+
116
Changes to Version 3.1-3
217

318
o Clarify docs to explain that ... argument is not passed to .vcov when it's a function in calls to Anova(), confidence Elliipse(), Confint(), deltaMethod(), linearHypothesis(), and S() (suggestion of Joe Ritter).

R/bcnPower.R

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# multivariate extenstion. Works for lm and lmer
66
# 2017-12-25: bug fix with multivariace bcnPower
77
# 2019-03-07: bug fix in estimateTransform.bcnPowerlmer, thanks to wouter@zoology.ubc.ca
8-
# 2019-11-14,15: change class(x) == "y" to inherits(x, "y") and likewise for !=
8+
# 2025-05-15: The argument gamma.min was not used, not it is
9+
# 2025-05-18: change class() == to inherits()
910

1011
bcnPower <- function(U, lambda, jacobian.adjusted=FALSE, gamma) {
1112
if(is.matrix(U)){
@@ -65,7 +66,8 @@ bcn.sv <- function(X, Y, weights, itmax=100, conv=.0001, verbose=FALSE,
6566
gamma.1d <- function(Y, weights, lambda, gamma, xqr){
6667
fn1 <- function(gam) bcnPowerllik(NULL, Y, weights, lambda=lambda,
6768
gamma=gam, xqr=xqr)$llik
68-
f <- optimize(f=fn1, interval=c(0.01, max(Y)), maximum=TRUE)
69+
# f <- optimize(f=fn1, interval=c(0.01, max(Y)), maximum=TRUE) bug, ignores gamma.min
70+
f <- optimize(f=fn1, interval=c(gamma.min, max(Y)), maximum=TRUE)
6971
list(lambda=lambda, gamma=f$maximum, llik=f$objective)
7072
}
7173
# get qr decomposition
@@ -84,14 +86,15 @@ bcn.sv <- function(X, Y, weights, itmax=100, conv=.0001, verbose=FALSE,
8486
last.value <- res
8587
res <- lambda.1d(Y, weights, res$lambda, res$gamma, xqr)
8688
res <- gamma.1d(Y, weights, res$lambda, res$gamma, xqr)
87-
if(res$gamma < 1.5 * gamma.min){
89+
if(res$gamma < 1.01 * gamma.min){
90+
# if(res$gamma < 1.5 * gamma.min){
8891
gamma.ok <- FALSE
8992
res <- lambda.1d(Y, weights, res$lambda, gamma.min, xqr)
9093
}
9194
crit <- (res$llik - last.value$llik)/abs(res$llik)
9295
if(verbose)
9396
print(data.frame(Iter=i, gamma=res$gamma,
94-
lambda=res$gamma, llik=res$llik, crit=crit))
97+
lambda=res$lambda, llik=res$llik, crit=crit))
9598
}
9699
if(i==itmax & conv > crit)
97100
warning(paste("No convergence in", itmax, "iterations, criterion =", crit, collapse=" "))
@@ -163,10 +166,15 @@ estimateTransform.bcnPower <- function(X, Y, weights,
163166
w <- if(is.null(weights)) 1 else sqrt(weights)
164167
xqr <- qr(w * as.matrix(X))
165168
# if d = 1 call bcn.sv and return, else call bcn.sv to get starting values.
166-
if(d == 1) bcn.sv(X, Y, weights, start=FALSE) else{
169+
if(d == 1) bcn.sv(X, Y, weights=weights,
170+
itmax=itmax, conv=conv, verbose=verbose,
171+
start=FALSE, gamma.min=gamma.min) else{
167172
# The rest of this code is for the multivariate case
168173
# get starting values for gamma
169-
sv <- apply(Y, 2, function(y) unlist(bcn.sv(X, y, weights, start=TRUE)))
174+
sv <- apply(Y, 2, function(y) unlist(
175+
bcn.sv(X, y, weights=weights,
176+
itmax=itmax, conv=conv, verbose=verbose,
177+
start=TRUE, gamma.min=gamma.min)))
170178
res <- as.list(as.data.frame(t(sv))) # output to a list
171179
# gamma.estimated converted to numeric, so fixup
172180
res$gamma.estimated <- ifelse(res$gamma.estimated==1, TRUE, FALSE)
@@ -197,7 +205,7 @@ estimateTransform.bcnPower <- function(X, Y, weights,
197205
res$gamma[!gamma.ok] <- gamma.min
198206
if(all(gamma.ok)){
199207
hess <- try(optimHess(c(res$lambda, res$gamma), fn4))
200-
res$invHess <- if(inherits(hess, "try-error")) NA else solve(-hess)
208+
res$invHess <- if (inherits(hess, "try-error")) NA else solve(-hess)
201209
} else {
202210
fn4a <- function(lam) fn4(c(lam, res$gamma))
203211
hess <- try(optimHess(res$lambda, fn4a)) # hessian for lambda only

R/carWeb.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# 2018-04-28: J. Fox. Check whether file exists before overwriting
1111
# 2024-09-19: J. Fox. Update URLs.
1212
# 2024-09-23 Deprecated most of the carWeb features; updated .Rd page
13+
# 2026-01-06 B. Price update URLs to S. Weisberg URLS
1314

14-
carWeb <- function (...){
15-
browseURL(webpage <- "https://www.john-fox.ca/Companion/index.html")
16-
}
17-
15+
carWeb <- function (...){
16+
browseURL(webpage <- "https://z.umn.edu/carbook")
17+
}

R/deltaMethod.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ deltaMethod <- function (object, ...) {
3434
}
3535

3636
deltaMethod.default <- function (object, g., vcov., func = g., constants, level=0.95, rhs=NULL,
37-
singular.ok=FALSE, ..., envir=parent.frame()) {
37+
singular.ok=FALSE, ..., envir=parent.frame()) {
3838
if (!is.character(g.))
3939
stop("The argument 'g.' must be a character string")
4040
if ((exists.method("coef", object, default=FALSE) ||
@@ -63,9 +63,10 @@ deltaMethod.default <- function (object, g., vcov., func = g., constants, level=
6363
for (i in seq_along(constants)) assign(names(constants[i]), constants[[i]], envir)}
6464
est <- eval(g., envir)
6565
names(est) <- NULL
66-
gd <- rep(0, q)
67-
for (i in 1:q) {
68-
gd[i] <- eval(D(g., para.names[i]), envir)
66+
gd <- gd2 <- rep(0, q)
67+
for (i in 1:q) {
68+
gd[i] <- eval(D(g., para.names[i]), envir)
69+
# gd[i] <- eval(Deriv::Deriv(f=g., x=para.names[i]), env=envir) # unused alt. using Deriv
6970
}
7071
se.est <- as.vector(sqrt(t(gd) %*% vcov. %*% gd))
7172
result <- data.frame(Estimate = est, SE = se.est, row.names = c(func))

R/logit.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
# 2022-02-04: Fix range tests (bug reported by Collin Erickson)
44
# Print message if percents converted to proportions
5+
# 2024-10-28: Fix bug that incorrectly sets percents <- FALSE
6+
# when percents arg is set (reported by Iain Proctor)
57

68
logit <- function(p, percents, adjust){
79
range.p <- range(p, na.rm=TRUE)
8-
if (missing(percents) && range.p[2] > 1){
9-
percents <- TRUE
10-
message("Note: largest value of p > 1 so values of p interpreted as percents")
11-
} else {
12-
percents <- FALSE
13-
}
10+
if (missing(percents)){
11+
if (range.p[2] > 1){
12+
percents <- TRUE
13+
message("Note: largest value of p > 1 so values of p interpreted as percents")
14+
} else {
15+
percents <- FALSE
16+
}
17+
}
1418
if (percents){
1519
if (range.p[1] < 0 || range.p[2] > 100) stop("p must be in the range 0 to 100")
1620
p <- p/100

build/vignette.rds

0 Bytes
Binary file not shown.

inst/doc/embedding.pdf

1.06 KB
Binary file not shown.

man/deltaMethod.Rd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ deltaMethod(m1, "1/(Intercept)")
198198
# The next example invokes the default method by extracting the
199199
# vector of estimates and covariance matrix explicitly
200200
deltaMethod(coef(m1), "t1/t2", vcov.=vcov(m1))
201+
# Mroz example, in carData, logistic regression using 2 predictors
202+
mroz.mod1 <- glm(lfp ~ k5 + age, family=binomial, data=Mroz)
203+
# The S() method in car returns exponentiated logistic regression coefficients by default
204+
S(mroz.mod1)
205+
# Exponentiated coefficient estimates can also be computed one at a time by deltaMethod
206+
deltaMethod(mroz.mod1, "exp(k5)")
207+
# The point estimate is the same as in the S() output but the confidence interval is
208+
# different because S() simply exponentiated the ends of the confidence interval before
209+
# exponentiation.
210+
# A more complex case is to get the estimate and standard error for the inverse logit
211+
# of the coefficient estimate.
212+
deltaMethod(mroz.mod1, "exp(b1)/(1 + exp(b1))", parameterNames= paste("b", 0:2, sep=""))
213+
# the parameterNames argument was used to change the name of the coefficient from
214+
# k5 to b1.
201215
}
202216
\keyword{ models }
203217
\keyword{ regression }

0 commit comments

Comments
 (0)