TABLE OF CONTENTS


simSurvival/makeagdata [ Functions ]

NAME

    makeagdata --- convert simulated data into Anderson-Gill format

FUNCTION

Create an Anderson-Gill formatted data frame given a set of event times and covariates.

SYNOPSIS

749 makeagdata <- function(m, Ji, Tij, deltaij, Zij)

INPUTS

    m      number of clusters
    Ji     cluster size
    Tij    event times simulated by generateevents
    deltaij censoring indicators
    Zij    covariates

OUTPUTS

    agdata Data frame with columns
       i       cluster indicator
       j       subject ID
       time    event time
       delta   event indicator
       ...     covariate columns

SOURCE

752 {
753     agdata <- data.frame(
754         i = rep(1:m, Ji),
755         j = c(sapply(Ji, function(x) return(1:x)), recursive = TRUE),
756         time = Tij,
757         delta = deltaij
758     )
759     agdata <- cbind(agdata, Zij)
760     return(agdata)  
761 }