summary.coxedExpdur: The mean or median expected duration

Description Usage Arguments Details Value Author(s) Examples

View source: R/summary.coxedExpdur.R

Description

This function takes the output of coxed and calculates the mean or median of the expected durations across the observations for which durations are estimated.

Usage

1
2
## S3 method for class 'coxedExpdur'
summary(object, stat = "mean", ...)

Arguments

object

The output from coxed. If newdata2=NULL, so that coxed is being used to predict duration instead of to calculate a marginal effect, then the class of the coxed output will be "coxedExpdur" and this function will be called by the generic summary function

stat

Either "mean" or "median"

...

For future methods

Details

If bootstrap=TRUE in the call to coxed then a bootstrapped standard error and confidence interval is reported for the given statistic as well.

Value

A scalar containing the mean or median duration, or a vector that also includes the bootstrapped standard error and confidence interval for this quantity.

Author(s)

Jonathan Kropko <jkropko@virginia.edu> and Jeffrey J. Harden <jharden2@nd.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
require(survival)
mv.surv <- Surv(martinvanberg$formdur, event = rep(1, nrow(martinvanberg)))
mv.cox <- coxph(mv.surv ~ postel + prevdef + cont + ident + rgovm + pgovno + tpgovno +
     minority, method = "breslow", data = martinvanberg)
summary(mv.cox)

# NPSF method
ed1 <- coxed(mv.cox, method="npsf")
ed1$baseline.functions
ed1$exp.dur
summary(ed1, stat="mean")
summary(ed1, stat="median")

ed1 <- coxed(mv.cox, method="npsf", bootstrap = TRUE)
ed1$exp.dur
summary(ed1, stat="mean")
summary(ed1, stat="median")

coxed documentation built on Aug. 2, 2020, 9:07 a.m.