Skip to content

Commit aad32ba

Browse files
authored
objects of class [clogit, coxph] are not supported by report() (#446)
Fixes #417
1 parent 28c16aa commit aad32ba

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

DESCRIPTION

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Collate:
111111
'report.character.R'
112112
'report.compare.loo.R'
113113
'report.compare_performance.R'
114+
'report.coxph.R'
114115
'report.data.frame.R'
115116
'report.default.R'
116117
'report.estimate_contrasts.R'

NAMESPACE

+10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ S3method(report,brmsfit)
3939
S3method(report,character)
4040
S3method(report,compare.loo)
4141
S3method(report,compare_performance)
42+
S3method(report,coxph)
4243
S3method(report,data.frame)
4344
S3method(report,default)
4445
S3method(report,estimate_contrasts)
@@ -64,6 +65,7 @@ S3method(report_effectsize,anova)
6465
S3method(report_effectsize,aov)
6566
S3method(report_effectsize,aovlist)
6667
S3method(report_effectsize,brmsfit)
68+
S3method(report_effectsize,coxph)
6769
S3method(report_effectsize,default)
6870
S3method(report_effectsize,glm)
6971
S3method(report_effectsize,glmmTMB)
@@ -80,6 +82,7 @@ S3method(report_info,anova)
8082
S3method(report_info,aov)
8183
S3method(report_info,aovlist)
8284
S3method(report_info,brmsfit)
85+
S3method(report_info,coxph)
8386
S3method(report_info,default)
8487
S3method(report_info,glm)
8588
S3method(report_info,glmmTMB)
@@ -93,6 +96,7 @@ S3method(report_info,survreg)
9396
S3method(report_info,zeroinfl)
9497
S3method(report_intercept,MixMod)
9598
S3method(report_intercept,brmsfit)
99+
S3method(report_intercept,coxph)
96100
S3method(report_intercept,default)
97101
S3method(report_intercept,glm)
98102
S3method(report_intercept,glmmTMB)
@@ -108,6 +112,7 @@ S3method(report_model,anova)
108112
S3method(report_model,aov)
109113
S3method(report_model,aovlist)
110114
S3method(report_model,brmsfit)
115+
S3method(report_model,coxph)
111116
S3method(report_model,default)
112117
S3method(report_model,glm)
113118
S3method(report_model,glmmTMB)
@@ -127,6 +132,7 @@ S3method(report_parameters,aovlist)
127132
S3method(report_parameters,brmsfit)
128133
S3method(report_parameters,character)
129134
S3method(report_parameters,compare_performance)
135+
S3method(report_parameters,coxph)
130136
S3method(report_parameters,data.frame)
131137
S3method(report_parameters,default)
132138
S3method(report_parameters,factor)
@@ -147,6 +153,7 @@ S3method(report_parameters,test_performance)
147153
S3method(report_parameters,zeroinfl)
148154
S3method(report_performance,MixMod)
149155
S3method(report_performance,brmsfit)
156+
S3method(report_performance,coxph)
150157
S3method(report_performance,default)
151158
S3method(report_performance,glm)
152159
S3method(report_performance,glmmTMB)
@@ -177,6 +184,7 @@ S3method(report_statistics,aovlist)
177184
S3method(report_statistics,brmsfit)
178185
S3method(report_statistics,character)
179186
S3method(report_statistics,compare_performance)
187+
S3method(report_statistics,coxph)
180188
S3method(report_statistics,data.frame)
181189
S3method(report_statistics,default)
182190
S3method(report_statistics,factor)
@@ -203,6 +211,7 @@ S3method(report_table,bayesfactor_models)
203211
S3method(report_table,brmsfit)
204212
S3method(report_table,character)
205213
S3method(report_table,compare_performance)
214+
S3method(report_table,coxph)
206215
S3method(report_table,data.frame)
207216
S3method(report_table,default)
208217
S3method(report_table,estimate_contrasts)
@@ -233,6 +242,7 @@ S3method(report_text,bayesfactor_models)
233242
S3method(report_text,brmsfit)
234243
S3method(report_text,character)
235244
S3method(report_text,compare_performance)
245+
S3method(report_text,coxph)
236246
S3method(report_text,data.frame)
237247
S3method(report_text,default)
238248
S3method(report_text,estimate_contrasts)

R/report.coxph.R

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#' @include report.lm.R
2+
#' @export
3+
report.coxph <- report.lm
4+
5+
#' @export
6+
report_effectsize.coxph <- report_effectsize.lm
7+
8+
#' @export
9+
report_table.coxph <- report_table.lm
10+
11+
#' @export
12+
report_statistics.coxph <- report_statistics.lm
13+
14+
#' @export
15+
report_parameters.coxph <- report_parameters.lm
16+
17+
#' @export
18+
report_intercept.coxph <- report_intercept.lm
19+
20+
#' @export
21+
report_model.coxph <- report_model.lm
22+
23+
#' @export
24+
report_performance.coxph <- report_performance.lm
25+
26+
#' @export
27+
report_info.coxph <- report_info.lm
28+
29+
#' @export
30+
report_text.coxph <- report_text.lm

R/report.lm.R

+6
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ report_intercept.lm <- function(x, table = NULL, ...) {
345345
} else {
346346
idx <- !is.na(table$Parameter) & table$Parameter == "(Intercept)"
347347
}
348+
349+
# sanity check - if model has no intercept, return NULL
350+
if (!any(idx)) {
351+
return(NULL)
352+
}
353+
348354
intercept <- table[idx, ]
349355

350356
estimate <- .find_regression_estimate(table)

0 commit comments

Comments
 (0)