Skip to content

Commit

Permalink
issue #933
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Oct 16, 2023
1 parent 891790f commit 77ce9b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/get_se_delta.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ get_se_delta <- function(model,
# align J and V: This might be a problematic hack, but I have not found examples yet.
V <- vcov
if (!isTRUE(ncol(J) == ncol(V))) {
beta <- get_coef(model)
beta <- get_coef(model, ...)
# Issue #718: ordinal::clm in test-pkg-ordinal.R
if (anyNA(beta) && anyDuplicated(names(beta)) && ncol(J) > ncol(V) && ncol(J) == length(beta) && length(stats::na.omit(beta)) == ncol(V)) {
J <- J[, !is.na(beta), drop = FALSE]
Expand Down
2 changes: 1 addition & 1 deletion R/get_vcov.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ get_vcov.default <- function(model,

# problem: duplicate colnames
if (anyDuplicated(colnames(out)) == 0) {
coefs <- get_coef(model)
coefs <- get_coef(model, ...)
# 1) Check above is needed for `AER::tobit` and others where `out`
# includes Log(scale) but `coef` does not Dangerous for `oridinal::clm`
# and others where there are important duplicate column names in
Expand Down
16 changes: 16 additions & 0 deletions inst/tinytest/test-pkg-gamlss.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ expect_equivalent(mm$estimate, em$response)
expect_equivalent(mm$std.error, em$std.error, tolerance = 0.01)


#
dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv", na.strings = "")
dat <- dat |>
transform(prop = rBE(nrow(dat), mu = 0.5, sigma = 0.2)) |>
na.omit()

# fit model
mod <- gamlss::gamlss(
prop ~ sex * body_mass_g + year + re(random = list(~ 1 | species, ~ 1 | island)),
family = BE(),
data = dat,
trace = FALSE)
cmp <- avg_comparisons(mod, what = "mu") |> suppressWarnings()
expect_inherits(cmp, "comparisons")

# end.


source("helpers.R")
Expand Down

0 comments on commit 77ce9b8

Please sign in to comment.