Skip to content

Commit

Permalink
transition to survival's nobs() methods (closes #1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Sep 26, 2024
1 parent 8931f0d commit 73f1fae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ S3method(nobs,Mclust)
S3method(nobs,aareg)
S3method(nobs,bbmle)
S3method(nobs,biglm)
S3method(nobs,coxph)
S3method(nobs,cv.glmnet)
S3method(nobs,felm)
S3method(nobs,fitdistr)
Expand All @@ -157,7 +156,6 @@ S3method(nobs,smooth.spline)
S3method(nobs,survdiff)
S3method(nobs,survfit)
S3method(nobs,survfit.cox)
S3method(nobs,survreg)
S3method(tidy,"NULL")
S3method(tidy,Arima)
S3method(tidy,Gam)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# broom (development version)

* Corrected `nobs` entries in `glance.coxph()` output: the package used to
return `length(object$linear.predictors)` (equal to `n` rather than `nevent`)
and now uses survival's method (#1224).

* Corrected confidence interval values in `tidy.boot()` and addressed errors
when bootstrapping confidence intervals for multiple terms (#1212).

Expand Down
12 changes: 0 additions & 12 deletions R/nobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ nobs.aareg <- function(object, ...) {
object$n[1] # obs / event times / event times in computation
}

# survival-survreg
#' @export
nobs.survreg <- function(object, ...) {
length(object$linear.predictors)
}

# survival-survfit
#' @export
nobs.survfit <- function(object, ...) {
Expand All @@ -141,12 +135,6 @@ nobs.survfit.cox <- function(object, ...) {
object$n
}

# survival-coxph
#' @export
nobs.coxph <- function(object, ...) {
length(object$linear.predictors)
}

# survival-pyears
#' @export
nobs.pyears <- function(object, ...) {
Expand Down

0 comments on commit 73f1fae

Please sign in to comment.