Skip to content

Commit

Permalink
objects of class [clogit, coxph] are not supported by report() (#446)
Browse files Browse the repository at this point in the history
Fixes #417
  • Loading branch information
strengejacke authored Jul 4, 2024
1 parent 28c16aa commit aad32ba
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Collate:
'report.character.R'
'report.compare.loo.R'
'report.compare_performance.R'
'report.coxph.R'
'report.data.frame.R'
'report.default.R'
'report.estimate_contrasts.R'
Expand Down
10 changes: 10 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ S3method(report,brmsfit)
S3method(report,character)
S3method(report,compare.loo)
S3method(report,compare_performance)
S3method(report,coxph)
S3method(report,data.frame)
S3method(report,default)
S3method(report,estimate_contrasts)
Expand All @@ -64,6 +65,7 @@ S3method(report_effectsize,anova)
S3method(report_effectsize,aov)
S3method(report_effectsize,aovlist)
S3method(report_effectsize,brmsfit)
S3method(report_effectsize,coxph)
S3method(report_effectsize,default)
S3method(report_effectsize,glm)
S3method(report_effectsize,glmmTMB)
Expand All @@ -80,6 +82,7 @@ S3method(report_info,anova)
S3method(report_info,aov)
S3method(report_info,aovlist)
S3method(report_info,brmsfit)
S3method(report_info,coxph)
S3method(report_info,default)
S3method(report_info,glm)
S3method(report_info,glmmTMB)
Expand All @@ -93,6 +96,7 @@ S3method(report_info,survreg)
S3method(report_info,zeroinfl)
S3method(report_intercept,MixMod)
S3method(report_intercept,brmsfit)
S3method(report_intercept,coxph)
S3method(report_intercept,default)
S3method(report_intercept,glm)
S3method(report_intercept,glmmTMB)
Expand All @@ -108,6 +112,7 @@ S3method(report_model,anova)
S3method(report_model,aov)
S3method(report_model,aovlist)
S3method(report_model,brmsfit)
S3method(report_model,coxph)
S3method(report_model,default)
S3method(report_model,glm)
S3method(report_model,glmmTMB)
Expand All @@ -127,6 +132,7 @@ S3method(report_parameters,aovlist)
S3method(report_parameters,brmsfit)
S3method(report_parameters,character)
S3method(report_parameters,compare_performance)
S3method(report_parameters,coxph)
S3method(report_parameters,data.frame)
S3method(report_parameters,default)
S3method(report_parameters,factor)
Expand All @@ -147,6 +153,7 @@ S3method(report_parameters,test_performance)
S3method(report_parameters,zeroinfl)
S3method(report_performance,MixMod)
S3method(report_performance,brmsfit)
S3method(report_performance,coxph)
S3method(report_performance,default)
S3method(report_performance,glm)
S3method(report_performance,glmmTMB)
Expand Down Expand Up @@ -177,6 +184,7 @@ S3method(report_statistics,aovlist)
S3method(report_statistics,brmsfit)
S3method(report_statistics,character)
S3method(report_statistics,compare_performance)
S3method(report_statistics,coxph)
S3method(report_statistics,data.frame)
S3method(report_statistics,default)
S3method(report_statistics,factor)
Expand All @@ -203,6 +211,7 @@ S3method(report_table,bayesfactor_models)
S3method(report_table,brmsfit)
S3method(report_table,character)
S3method(report_table,compare_performance)
S3method(report_table,coxph)
S3method(report_table,data.frame)
S3method(report_table,default)
S3method(report_table,estimate_contrasts)
Expand Down Expand Up @@ -233,6 +242,7 @@ S3method(report_text,bayesfactor_models)
S3method(report_text,brmsfit)
S3method(report_text,character)
S3method(report_text,compare_performance)
S3method(report_text,coxph)
S3method(report_text,data.frame)
S3method(report_text,default)
S3method(report_text,estimate_contrasts)
Expand Down
30 changes: 30 additions & 0 deletions R/report.coxph.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#' @include report.lm.R
#' @export
report.coxph <- report.lm

#' @export
report_effectsize.coxph <- report_effectsize.lm

#' @export
report_table.coxph <- report_table.lm

#' @export
report_statistics.coxph <- report_statistics.lm

#' @export
report_parameters.coxph <- report_parameters.lm

#' @export
report_intercept.coxph <- report_intercept.lm

#' @export
report_model.coxph <- report_model.lm

#' @export
report_performance.coxph <- report_performance.lm

#' @export
report_info.coxph <- report_info.lm

#' @export
report_text.coxph <- report_text.lm
6 changes: 6 additions & 0 deletions R/report.lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ report_intercept.lm <- function(x, table = NULL, ...) {
} else {
idx <- !is.na(table$Parameter) & table$Parameter == "(Intercept)"
}

# sanity check - if model has no intercept, return NULL
if (!any(idx)) {
return(NULL)
}

intercept <- table[idx, ]

estimate <- .find_regression_estimate(table)
Expand Down

0 comments on commit aad32ba

Please sign in to comment.