broom (version 0.3.7)

cch_tidiers: tidiers for case-cohort data

Description

Tidiers for case-cohort analyses: summarize each estimated coefficient, or test the overall model.

Usage

## S3 method for class 'cch':
tidy(x, conf.level = 0.95, ...)

## S3 method for class 'cch': glance(x, ...)

Arguments

x
a "cch" object
conf.level
confidence level for CI
...
extra arguments (not used)

Value

  • All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.

    tidy returns a data.frame with one row for each term

  • termname of term
  • estimateestimate of coefficient
  • stderrorstandard error
  • statisticZ statistic
  • p.valuep-value
  • conf.lowlow end of confidence interval
  • conf.highhigh end of confidence interval
  • glance returns a one-row data.frame with the following columns:
  • scorescore
  • rscorerscore
  • p.valuep-value from Wald test
  • iternumber of iterations
  • nnumber of predictions
  • neventnumber of events

Details

It is not clear what an augment method would look like, so none is provided. Nor is there currently any way to extract the covariance or the residuals.

See Also

cch

Examples

Run this code
if (require("survival", quietly = TRUE)) {
    # examples come from cch documentation
    subcoh <- nwtco$in.subcohort
    selccoh <- with(nwtco, rel==1|subcoh==1)
    ccoh.data <- nwtco[selccoh,]
    ccoh.data$subcohort <- subcoh[selccoh]
    ## central-lab histology
    ccoh.data$histol <- factor(ccoh.data$histol,labels=c("FH","UH"))
    ## tumour stage
    ccoh.data$stage <- factor(ccoh.data$stage,labels=c("I","II","III" ,"IV"))
    ccoh.data$age <- ccoh.data$age/12 # Age in years

    fit.ccP <- cch(Surv(edrel, rel) ~ stage + histol + age, data = ccoh.data,
                   subcoh = ~subcohort, id= ~seqno, cohort.size = 4028)

    tidy(fit.ccP)

    # coefficient plot
    library(ggplot2)
    ggplot(tidy(fit.ccP), aes(x = estimate, y = term)) + geom_point() +
        geom_errorbarh(aes(xmin = conf.low, xmax = conf.high), height = 0) +
        geom_vline()

    # compare between methods
    library(dplyr)
    fits <- data_frame(method = c("Prentice", "SelfPrentice", "LinYing")) %>%
        group_by(method) %>%
        do(tidy(cch(Surv(edrel, rel) ~ stage + histol + age, data = ccoh.data,
                    subcoh = ~subcohort, id= ~seqno, cohort.size = 4028,
                    method = .$method)))

    # coefficient plots comparing methods
    ggplot(fits, aes(x = estimate, y = term, color = method)) + geom_point() +
        geom_errorbarh(aes(xmin = conf.low, xmax = conf.high)) +
        geom_vline()
}

Run the code above in your browser using DataLab