Skip to content

Commit

Permalink
Merge pull request #137 from adibender/devel
Browse files Browse the repository at this point in the history
CRAN release
  • Loading branch information
adibender authored Feb 8, 2020
2 parents 8ad9310 + 406aedb commit 43463e8
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 38 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ jobs:
- Rscript -e 'remotes::install_cran("pammtools", dependencies = TRUE)'
- Rscript -e 'remotes::install_cran("TBFmultinomial", dependencies = TRUE)'
- Rscript -e 'remotes::install_github("jimhester/covr")'
- Rscript -e 'remotes::install_cran("pkgdown")'
- Rscript -e 'remotes::install_cran("scam")'
- Rscript -e 'remotes::install_cran("RColorBrewer")'
- Rscript -e 'remotes::install_cran("timereg")'
- Rscript -e 'remotes::install_cran("grid")'
- Rscript -e 'remotes::install_cran("gridExtra")'
- Rscript -e 'remotes::install_cran("coxme")'
- Rscript -e 'remotes::install_cran("knitr")'
- Rscript -e 'remotes::install_cran("rmarkdown")'
- Rscript -e 'remotes::install_cran("pec")'
- Rscript -e 'remotes::install_cran("devtools")'
# whitelist
branches:
only:
Expand Down
18 changes: 4 additions & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: pammtools
Title: Piece-Wise Exponential Additive Mixed Modeling Tools for Survival Analysis
Version: 0.2.0
Date: 2020-01-30
Version: 0.2.1
Date: 2020-02-07
Authors@R: c(
person("Andreas", "Bender", , "[email protected]", role = c("aut", "cre"), comment=c(ORCID = "0000-0001-5628-8611")),
person("Fabian", "Scheipl", , "[email protected]", role = c("aut")))
Description: The Piece-wise exponential (Additive Mixed) Model
(PAMM; Bender and Scheipl (2018) <doi: 10.1177/1471082X17748083>) is a
powerful model class for the analysis of survival (or time-to-event) data,
based on Generalized Additive (Mixed) Models (GA(M)Ms). It offers intuitive specification and robust estimation of complex survival models with stratified baseline hazards, random effects, time-varying effects, time-dependent covariates and cumulative effects (Bender and others (2018) <doi:10.1093/biostatistics/kxy003>.
based on Generalized Additive (Mixed) Models (GA(M)Ms). It offers intuitive specification and robust estimation of complex survival models with stratified baseline hazards, random effects, time-varying effects, time-dependent covariates and cumulative effects (Bender and others (2018) <doi: 10.1093/biostatistics/kxy003>.
pammtools provides tidy workflow for survival analysis with PAMMs,
including data simulation, transformation and other functions for data
preprocessing and model post-processing as well as visualization.
Expand All @@ -30,17 +30,7 @@ Imports:
mvtnorm,
pec
Suggests:
RColorBrewer,
scam,
coxme,
testthat,
timereg,
knitr,
rmarkdown,
grid,
gridExtra,
covr,
pkgdown
testthat
License: MIT + file LICENSE
LazyData: true
URL: https://github.com/adibender/pammtools
Expand Down
11 changes: 6 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# pammtools 0.2.0
# pammtools 0.2.1
* Adds a new interface for model estimation called `pamm`, which is a thin wrapper
around `mgcv::gam` with some arguments pre-set.
* Adds S3 methods `predict.pamm` and `predictSurvProb.pamm`
* Adds support for model evaluation using package **`pec`**
* Adds S3 method `predict.pammpredictSurvProb.pamm`
* Adds support and vignette for model evaluation using package **`pec`**
* Fixed bug when CIs were calculated simulation based and model contained factor variables
* Removed unnecessary dependencies in Imports/Suggests

# pammtools 0.1.15
* Interface for specification of data transformation in `as_ped` changed. The vertical bar `|` is no longer necessary to indicate concurrent or cumulative effects
Expand Down Expand Up @@ -32,12 +33,12 @@ Allows to calculate (log-)hazard ratios.
* Added new vignette linking to tutorial paper (online only)

# pammtools 0.1.9
* maintainance update: fixes CRAN issues due to new RNG
* maintenance update: fixes CRAN issues due to new RNG

# pammtools 0.1.8

## documentation
* Updates to cummulative effect vignette
* Updates to cumulative effect vignette
* Updates to time-dependent covariate vignette (+ data transformation)
* Update citation information

Expand Down
2 changes: 1 addition & 1 deletion R/add-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ preproc_reference <- function(reference, cnames, n_rows) {
#' Add (cumulative) hazard based on the provided data set and model.
#' If \code{ci=TRUE} confidence intervals (CI) are also added. Their width can
#' be controlled via the \code{se_mult} argument. The method by which the
#' CI are calculated can be specifie by \code{ci_type}.
#' CI are calculated can be specified by \code{ci_type}.
#' This is a wrapper around
#' \code{\link[mgcv]{predict.gam}}. When \code{reference} is specified, the
#' (log-)hazard ratio is calculated.
Expand Down
2 changes: 1 addition & 1 deletion R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @inheritParams pec::predictSurvProb
#' @importFrom pec predictSurvProb
#' @importFrom purrr map
#' @param times A vector of times for which predictions should be generated.
#'
#' @export
predictSurvProb.pamm <- function(
object,
Expand Down
3 changes: 2 additions & 1 deletion R/rpexp.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' Draw random numbers from piece-wise exponential distribution.
#'
#' This is a copy of the same function from \code{\link[msm]{rpexp}}.
#' This is a copy of the same function from \code{rpexp} from package
#' \pkg{msm}.
#' Copied here to reduce dependencies.
#'
#' @inheritParams msm::rpexp
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ devtools::install_github("adibender/pammtools")

**`pammtools`** facilitates the estimation of Piece-wise exponential Additive
Mixed Models (PAMMs) for time-to-event data.
PAMMs can be represeted as generalized additive models and can therefore
PAMMs can be represented as generalized additive models and can therefore
be estimated using GAM software (e.g. **`mgcv`**), which, compared to other packages for survival analysis, often offers
more flexibility w.r.t. to the specification of covariate effects
(e.g. non-linear, time-varying effects, cumulative effects, etc.).
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Test environments
* Local R 3.6.1
* Local Ubuntu Linux R 3.6.2
* R release and devel with Travis CI
* Appveyor (patched and devel)
* win-builder
Expand Down
2 changes: 1 addition & 1 deletion man/add_hazard.Rd

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

4 changes: 3 additions & 1 deletion man/predictSurvProb.pamm.Rd

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

16 changes: 8 additions & 8 deletions tests/testthat/test-cumulative-coefficients.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ test_that("Cumulative coefficients work", {
df$x1 <- as.factor(rep(letters[1:3], each = nrow(df) / 3L))

## aalen model
library(timereg)
mod <- aalen(Surv(days, status) ~ x1 + age, data = df)
cumu_coef_aalen <- get_cumu_coef(
mod,
df,
terms = c("(Intercept)", "x1"))
expect_data_frame(cumu_coef_aalen, nrows = 42L, ncols = 6L)
expect_equal(unique(cumu_coef_aalen$variable), c("(Intercept)", "x1b", "x1c"))
# library(timereg)
# mod <- aalen(Surv(days, status) ~ x1 + age, data = df)
# cumu_coef_aalen <- get_cumu_coef(
# mod,
# df,
# terms = c("(Intercept)", "x1"))
# expect_data_frame(cumu_coef_aalen, nrows = 42L, ncols = 6L)
# expect_equal(unique(cumu_coef_aalen$variable), c("(Intercept)", "x1b", "x1c"))

## pam
ped <- as_ped(df, formula = Surv(days, status)~ x1 + age)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-predict-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ context("Predict functions")
engine = "bam", method = "fREML", discrete = TRUE)

## predictSurvProb (pec) generic
spmat <- predictSurvProb(pam, tumor[21:23,], times = c(90, 500, 1217))
spmat <- predictSurvProb.pamm(pam, tumor[21:23,], times = c(90, 500, 1217))
expect_identical(
round(spmat, 2),
matrix(
Expand All @@ -24,8 +24,8 @@ context("Predict functions")
)
)

expect_error(predictSurvProb(pam, tumor[21:23,], times = c(90, 500, 2000)))
spmat2 <- predictSurvProb(pam2, tumor[21:23,], times = c(90, 500, 1217))
expect_error(predictSurvProb.pamm(pam, tumor[21:23,], times = c(90, 500, 2000)))
spmat2 <- predictSurvProb.pamm(pam2, tumor[21:23,], times = c(90, 500, 1217))
expect_identical(round(spmat, 2), round(spmat2, 2))

}
Expand Down
1 change: 0 additions & 1 deletion vignettes/model-evaluation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ library(ggplot2)
theme_set(theme_bw())
library(survival)
library(pec)
library(obliqueRSF)
```

In this vignette we illustrate how to obtain model performance measures for
Expand Down

0 comments on commit 43463e8

Please sign in to comment.