data.plot: Plot the histograms of simulated data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/data.plot.R

Description

This function is called by survsim.plot and is not intended to be used by itself.

Usage

1
data.plot(data, xb, bins = 30)

Arguments

data

A data frame of simulated duration data in which the duration variable is called y. Generally, this data frame is taken from the data attribute of the sim.survdata function

xb

A vector of the linear predictors, combining the covariates and coefficients from the simulation. Generally, this data frame is taken from the xb attribute of the sim.survdata function

bins

The number of bins to draw in each histogram

Details

This function produces three histograms, one of the simulated durations, one of the linear predictors, and one of the exponentiated linear predictors. It uses facet_wrap within a call to ggplot to arrange the plots.

Value

A figure of class "gg" and "ggplot"

Author(s)

Jonathan Kropko <jkropko@virginia.edu> and Jeffrey J. Harden <jharden2@nd.edu>

See Also

survsim.plot, sim.survdata

Examples

1
2
simdata <- sim.survdata(N=1000, T=100, num.data.frames=1)
data.plot(simdata$data, simdata$xb)

Example output

Loading required package: rms
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package:HmiscThe following objects are masked frompackage:base:

    format.pval, units

Loading required package: SparseM

Attaching package:SparseMThe following object is masked frompackage:base:

    backsolve

Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-33. For overview type 'help("mgcv-package")'.

coxed documentation built on Aug. 2, 2020, 9:07 a.m.