R: tidiers for case-cohort data

cch_tidiers {broom} | R Documentation

## 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)

### 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.

### 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

`term` | name of term
`estimate` | estimate of coefficient
`stderror` | standard error
`statistic` | Z statistic
`p.value` | p-value
`conf.low` | low end of confidence interval
`conf.high` | high end of confidence interval

`glance` returns a one-row data.frame with the following columns:

`score` | score
`rscore` | rscore
`p.value` | p-value from Wald test
`iter` | number of iterations
`n` | number of predictions
`nevent` | number of events

### See Also

cch

### Examples

    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(xintercept = 0)

        # 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(xintercept = 0)
    }

[Package broom version 0.4.2 Index]