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

469 cran #470

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Type: Package
Package: mmrm
Title: Mixed Models for Repeated Measures
Version: 0.3.12.9003
Version: 0.3.13
Authors@R: c(
person("Daniel", "Sabanes Bove", , "daniel.sabanes_bove@rconis.com", role = c("aut", "cre")),
person("Daniel", "Sabanes Bove", , "daniel.sabanes_bove@rconis.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-0176-9239")),
person("Liming", "Li", , "liming.li@roche.com", role = "aut"),
person("Julia", "Dedic", , "julia.dedic@roche.com", role = "aut"),
person("Doug", "Kelkhoff", , "doug.kelkhoff@roche.com", role = "aut"),
Expand All @@ -21,7 +22,8 @@ Authors@R: c(
person("Gilead Sciences, Inc.", role = c("cph", "fnd")),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")),
person("Merck Sharp & Dohme, Inc.", role = c("cph", "fnd")),
person("AstraZeneca plc", role = c("cph", "fnd"))
person("AstraZeneca plc", role = c("cph", "fnd")),
person("inferential.biostatistics GmbH", role = c("cph", "fnd"))
)
Description: Mixed models for repeated measures (MMRM) are a popular
choice for analyzing longitudinal continuous outcomes in randomized
Expand Down
7 changes: 0 additions & 7 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,15 @@ export(refit_multiple_optimizers)
export(std_start)
export(tidy)
import(checkmate)
importFrom(Matrix,.bdiag)
importFrom(Rcpp,evalCpp)
importFrom(Rdpack,reprompt)
importFrom(generics,augment)
importFrom(generics,glance)
importFrom(generics,tidy)
importFrom(lifecycle,deprecated)
importFrom(methods,is)
importFrom(nlme,VarCorr)
importFrom(parallel,clusterApply)
importFrom(stats,AIC)
importFrom(stats,BIC)
importFrom(stats,acf)
importFrom(stats,coef)
importFrom(stats,deviance)
importFrom(stats,drop.terms)
Expand All @@ -69,7 +65,4 @@ importFrom(stats,residuals)
importFrom(stats,simulate)
importFrom(stats,terms)
importFrom(stats,vcov)
importFrom(stringr,boundary)
importFrom(tibble,as_tibble)
importFrom(utils,modifyList)
useDynLib(mmrm, .registration = TRUE)
18 changes: 9 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# mmrm 0.3.12.9003
# mmrm 0.3.13

### Bug Fixes

- Previously `emmeans` will return `NA` for spatial covariance structure. This is fixed now.
- Previously `car::Anova` will give incorrect results if an interaction term is included and the order of the covariate of interest is not the first categorical variable. This is fixed now.
- Previously `car::Anova` will fail if the model does not contain intercept. This is fixed now.
- Previously, `mmrm` will ignore contrasts defined for covariates in the input data set. This is fixed now.
- Previously, `predict` will always require the response to be valid, even for unconditional predictions. This is fixed now and unconditional prediction do not require the response to be valid anymore.
- When running with `TMB` package versions below 1.9.15, MMRM fit results are not completely reproducible. While this may not be relevant for most applications, because the numerical differences are very small, we now issue a warning to the user if this is the case. We advise users to upgrade their `TMB` package versions to 1.9.15 or higher to ensure reproducibility.
- Previously, `mmrm` ignored contrasts defined for covariates in the input data set. This is fixed now.
- Previously, `predict` always required the response to be valid, even for unconditional predictions. This is fixed now and unconditional prediction does not require the response to be valid or present any longer.
- `model.frame` has been updated to ensure that the `na.action` works correctly.
- Previously `emmeans::emmeans` returned `NA` for spatial covariance structures. This is fixed now.
- Previously `car::Anova` gave incorrect results if an interaction term is included and the covariate of interest was not the first categorical variable. This is fixed now.
- Previously `car::Anova` failed if the model did not contain an intercept. This is fixed now.

### Miscellaneous

- Upon fitting an MMRM, it is checked whether a not reproducible optimization feature of `TMB` is turned on. If so, a warning is issued to the user once per session.
- `model.matrix` is updated to ensure that the `NA` values are dropped. Additionally, an argument `use_response` is added to decide whether records with `NA` values in the response should be discarded.
- `model.frame` is updated to ensure that the `na.action` works.
- `predict` is updated to allow duplicated subject IDs for unconditional prediction.
- `mmrm` now checks on the positive definiteness of the covariance matrix `theta_vcov`. If it is not positive definite, non-convergence is messaged appropriately.
- `model.matrix` has been updated to ensure that the `NA` values are dropped. Additionally, an argument `use_response` is added to decide whether records with `NA` values in the response should be discarded.
- `predict` has been updated to allow duplicated subject IDs for unconditional prediction.

# mmrm 0.3.12

Expand Down
2 changes: 1 addition & 1 deletion R/component.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Component Access for `mmrm_tmb` Objects
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @param object (`mmrm_tmb`)\cr the fitted MMRM.
#' @param name (`character`)\cr the component(s) to be retrieved.
Expand Down
6 changes: 3 additions & 3 deletions R/cov_struct.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ COV_TYPES <- local({ # nolint

#' Covariance Types
#'
#' @description `r lifecycle::badge("maturing")`
#' @description `r lifecycle::badge("stable")`
#'
#' @param form (`character`)\cr covariance structure type name form. One or
#' more of `"name"`, `"abbr"` (abbreviation), or `"habbr"` (heterogeneous
Expand Down Expand Up @@ -207,7 +207,7 @@ tmb_cov_type <- function(cov) {

#' Define a Covariance Structure
#'
#' @description `r lifecycle::badge("maturing")`
#' @description `r lifecycle::badge("stable")`
#'
#' @param type (`string`)\cr the name of the covariance structure type to use.
#' For available options, see `cov_types()`. If a type abbreviation is used
Expand Down Expand Up @@ -359,7 +359,7 @@ print.cov_struct <- function(x, ...) {

#' Coerce into a Covariance Structure Definition
#'
#' @description `r lifecycle::badge("maturing")`
#' @description `r lifecycle::badge("stable")`
#'
#' @details
#' A covariance structure can be parsed from a model definition formula or call.
Expand Down
6 changes: 3 additions & 3 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#' Example Data on FEV1
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @note Measurements of FEV1 (forced expired volume in one second) is a measure
#' of how quickly the lungs can be emptied. Low levels of FEV1 may indicate
Expand All @@ -27,7 +27,7 @@

#' Example Data on BCVA
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @note Measurements of BCVA (best corrected visual acuity) is a measure of how
#' how many letters a person can read off of an eye chart using corrective
Expand All @@ -47,7 +47,7 @@

#' Cache Data for `mmrm` Model Comparison
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @note The cached data for comparison is used for the vignettes generation.
#' Please make sure that this data is refreshed before each package release
Expand Down
8 changes: 4 additions & 4 deletions R/fit.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Fitting an MMRM with Single Optimizer
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' This function helps to fit an MMRM using `TMB` with a single optimizer,
#' while capturing messages and warnings.
Expand Down Expand Up @@ -127,7 +127,7 @@ h_summarize_all_fits <- function(all_fits) {

#' Refitting MMRM with Multiple Optimizers
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @param fit (`mmrm_fit`)\cr original model fit from [fit_single_optimizer()].
#' @param ... Additional arguments passed to [mmrm_control()].
Expand Down Expand Up @@ -194,7 +194,7 @@ refit_multiple_optimizers <- function(fit,

#' Control Parameters for Fitting an MMRM
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#' Fine-grained specification of the MMRM fit details is possible using this
#' control function.
#'
Expand Down Expand Up @@ -313,7 +313,7 @@ mmrm_control <- function(n_cores = 1L,

#' Fit an MMRM
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' This is the main function fitting the MMRM.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/interop-emmeans.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Support for `emmeans`
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' This package includes methods that allow `mmrm` objects to be used
#' with the `emmeans` package. `emmeans` computes estimated marginal means
Expand Down
2 changes: 1 addition & 1 deletion R/mmrm-methods.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Methods for `mmrm` Objects
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @param object (`mmrm`)\cr the fitted MMRM including Jacobian and call etc.
#' @param ... not used.
Expand Down
7 changes: 0 additions & 7 deletions R/mmrm-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@
#' @useDynLib mmrm, .registration = TRUE
#' @importFrom Rcpp evalCpp
#' @import checkmate
#' @importFrom lifecycle deprecated
#' @importFrom Matrix .bdiag
#' @importFrom methods is
#' @importFrom stats acf
#' @importFrom stringr boundary
#' @importFrom parallel clusterApply
#' @importFrom Rdpack reprompt
#' @importFrom utils modifyList
#' @importFrom tibble as_tibble
NULL

#' @importFrom generics tidy
Expand Down
4 changes: 2 additions & 2 deletions R/testing.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Calculation of Degrees of Freedom for One-Dimensional Contrast
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#' Calculates the estimate, adjusted standard error, degrees of freedom,
#' t statistic and p-value for one-dimensional contrast.
#'
Expand Down Expand Up @@ -35,7 +35,7 @@ df_1d <- function(object, contrast) {

#' Calculation of Degrees of Freedom for Multi-Dimensional Contrast
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#' Calculates the estimate, standard error, degrees of freedom,
#' t statistic and p-value for one-dimensional contrast, depending on the method
#' used in [mmrm()].
Expand Down
2 changes: 1 addition & 1 deletion R/tidiers.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Tidying Methods for `mmrm` Objects
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' These methods tidy the estimates from an `mmrm` object into a
#' summary.
Expand Down
2 changes: 1 addition & 1 deletion R/tmb-methods.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Methods for `mmrm_tmb` Objects
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' @param object (`mmrm_tmb`)\cr the fitted MMRM object.
#' @param x (`mmrm_tmb`)\cr same as `object`.
Expand Down
2 changes: 1 addition & 1 deletion R/tmb.R
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ h_mmrm_tmb_fit <- function(tmb_object,

#' Low-Level Fitting Function for MMRM
#'
#' @description `r lifecycle::badge("experimental")`
#' @description `r lifecycle::badge("stable")`
#'
#' This is the low-level function to fit an MMRM. Note that this does not
#' try different optimizers or adds Jacobian information etc. in contrast to
Expand Down
14 changes: 9 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ h_split_control <- function(control, ...) {
assert_class(control, "mmrm_control")
l <- length(control$optimizers)
lapply(seq_len(l), function(i) {
ret <- modifyList(control, list(...))
ret <- utils::modifyList(control, list(...))
ret$optimizers <- control$optimizers[i]
ret
})
Expand Down Expand Up @@ -196,10 +196,14 @@ h_partial_fun_args <- function(fun, ..., additional_attr = list()) {
}
do.call(
structure,
args = modifyList(list(
.Data = fun, args = modifyList(args, a_args),
class = c("partial", "function")
), additional_attr)
args = utils::modifyList(
list(
.Data = fun,
args = utils::modifyList(args, a_args),
class = c("partial", "function")
),
additional_attr
)
)
}

Expand Down
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ DPD
DeclareMathOperator
Dohme
FEV
GmbH
Gower
Hoffmann
Indexible
Expand Down Expand Up @@ -40,6 +41,7 @@ adh
ansi
ar
ast
biostatistics
blockdiag
boldsymbol
cdots
Expand Down
2 changes: 1 addition & 1 deletion man/as.cov_struct.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/bcva_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/cached_mmrm_results.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/component.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/cov_struct.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/covariance_types.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/df_1d.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/df_md.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/emmeans_support.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/fev_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/fit_mmrm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading