nriskReport: Number at Risk Report

View source: R/nriskReport.r

nriskReportR Documentation

Number at Risk Report

Description

Graph number of subjects at risk

Usage

nriskReport(
  formula,
  groups = NULL,
  time0 = "randomization",
  data = NULL,
  subset = NULL,
  na.action = na.retain,
  ylab = "Number Followed",
  panel = "nrisk",
  head = NULL,
  tail = NULL,
  h = 5.5,
  w = 5.5,
  outerlabels = TRUE,
  append = FALSE,
  popts = NULL
)

Arguments

formula

a formula with time and the left hand side, and with variables on the right side being possible stratification variables. If no stratification put 1 as the right hand side. Specify unique subject IDs by including a term id() if subjects have more than one observation.

groups

a character string naming a superpositioning variable. Must also be included in formula.

time0

a character string defining the meaning of time zero in follow-up. Default is "randomization".

data

data frame

subset

a subsetting epression for the entire analysis

na.action

a NA handling function for data frames, default is na.retain

ylab

character string if you want to override "Number Followed"

panel

character string. Name of panel, which goes into file base names and figure labels for cross-referencing. The default is 'nrisk'.

head

character string. Specifies initial text in the figure caption, otherwise a default is used

tail

optional character string. Specifies final text in the figure caption, e.g., what might have been put in a footnote in an ordinary text page. This appears just before any needles.

h

numeric. Height of plot, in inches

w

numeric. Width of plot

outerlabels

logical that if TRUE, pass lattice graphics through the latticeExtra package's useOuterStripsfunction if there are two conditioning (paneling) variables, to put panel labels in outer margins.

append

logical. Set to FALSE to start a new panel

popts

list specifying extra arguments to pass to Ecdf. A common use is for example popts=list(layout=c(columns,rows)) to be used in rendering lattice plots. key and panel are also frequently used.

Details

nriskReport generates multi-panel charts, separately for categorical analysis variables. Each panel depicts the number at risk as a function of follow-up time. The Hmisc Ecdf function is used. Stratification is by treatment or other variables. It is assumed that this function is only run on randomized subjects. If an id variable is present but groups and stratification variables are not, other plots are also produced: a histogram of the number of visits per subject, a histogram of times at which subjects have visits, the average number of contacts as a function of elapsed time, and a histogram showing the distribution of the longest gap between visits over subjects.

Examples

# See test.Rnw in tests directory

harrelfe/greport documentation built on Sept. 9, 2023, 8:08 a.m.