Description Usage Arguments Examples
MinMaxLines
is an internal function to transform the simulation
object to include only the min and max of the intervals set by ci
in
the coxsim
command, as well as the lower and upper bounds of the
middle 50 percent of these intervals. It also returns the medians.
1 | MinMaxLines(df, byVars = "Xj", hr = FALSE, strata = FALSE, clean = FALSE)
|
df |
a data frame or a simulation class object. |
byVars |
character vector of the variables to subset the data frame by.
The default is |
hr |
logical indicating whether or not |
strata |
logical indicating whether or not |
clean |
logical, whether or not to clean up the output data frame to
only include |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Load Carpenter (2002) data
data("CarpenterFdaData")
# Load survival package
library(survival)
# Run basic model
M1 <- coxph(Surv(acttime, censor) ~ prevgenx + lethal +
deathrt1 + acutediz + hosp01 + hhosleng +
mandiz01 + femdiz01 + peddiz01 + orphdum +
vandavg3 + wpnoavg3 + condavg3 + orderent +
stafcder, data = CarpenterFdaData)
# Simulate Hazard Ratios
Sim1 <- coxsimLinear(M1, b = "stafcder",
Xj = c(1237, 1600),
Xl = c(1000, 1000),
qi = "Hazard Ratio",
spin = TRUE, ci = 0.99)
# Find summary statistics of the constricted interval
Sum <- MinMaxLines(Sim1, clean = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.