Skip to contents

Add model summary to an object of class gaze

Usage

addFitSummary(df, fit, statsname = "")

Arguments

df

An object of class "gaze" or "autoReg"

fit

An object of class "glm" or "lm" or "crr"

statsname

character Name of statistics

Value

addFitSummary returns an object of gaze or autoReg - the same class as df

Examples

require(survival)
require(dplyr)
#> Loading required package: dplyr
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
data(cancer,package="survival")
fit=coxph(Surv(time,status)~rx+age+sex+nodes+obstruct+perfor,data=colon)
df=autoReg(fit,uni=FALSE)
final=fit2final(fit)
df %>% addFitSummary(final,statsname="HR (final)") %>% myft()

Dependent: Surv(time, status)

all

HR (multivariable)

HR (final)

rx

Obs

624 (34.2%)

Lev

608 (33.4%)

0.94 (0.81-1.09, p=.409)

0.94 (0.80-1.09, p=.408)

Lev+5FU

590 (32.4%)

0.63 (0.54-0.75, p<.001)

0.64 (0.54-0.75, p<.001)

age

Mean ± SD

59.8 ± 11.9

1.00 (1.00-1.01, p=.571)

sex

Mean ± SD

0.5 ± 0.5

0.92 (0.81-1.05, p=.242)

nodes

Mean ± SD

3.7 ± 3.6

1.09 (1.08-1.10, p<.001)

1.09 (1.08-1.10, p<.001)

obstruct

Mean ± SD

0.2 ± 0.4

1.26 (1.07-1.48, p=.006)

1.27 (1.08-1.49, p=.003)

perfor

Mean ± SD

0.0 ± 0.2

1.26 (0.88-1.79, p=.210)

n=1822, events=897, Likelihood ratio test=178.71 on 7 df(p<.001)