nriskReport: Number at Risk Report

Description Usage Arguments Details Examples

View source: R/nriskReport.r

Description

Graph number of participants at risk

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
nriskReport(
  formula,
  time0 = "randomization",
  data = NULL,
  subset = NULL,
  na.action = na.retain,
  study = " ",
  ylab = "Number Followed",
  head = NULL,
  tail = NULL,
  h = 400,
  w = 700
)

Arguments

formula

a formula with time on 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 participant IDs by including a term id() if participantss have more than one observation.

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

study

character string identifying the study; used in multi-study reports or where distinct patient strata are analyzed separately. Used to fetch the study-specific metadata stored by sethreportOption. Single study reports just use study=' '.

ylab

character string if you want to override "Number Followed"

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 pixels

w

numeric. Width of plot

Details

nriskReport generates several plots where stratification is by the cross-classifications of all right-hand-side variables other than the time variable and an id variable. The first plot depicts the number at risk as a function of follow-up time. It is assumed that this function is only run on randomized participants. If an id variable is present but stratification variables are not, other plots are also produced: a histogram of the number of contacts per participant, a histogram of times at which participants have contacts, the average number of contacts as a function of elapsed time, and a histogram showing the distribution of the longest gap between contacts over participants.

Examples

1
# See test.Rnw in tests directory

harrelfe/hreport documentation built on July 26, 2021, 9:09 a.m.