plotsimexaft {simexaft} | R Documentation |
Plot the Extrapolation Curve
Description
A function to give the plot of the extrapolation curve for any covariables of the AFT model.
Usage
plotsimexaft(obj, var, extrapolation=c("linear","quadratic","both"), ylimit)
Arguments
obj |
an object returned by the function "simexaft". |
var |
a character string of any covariate used in the AFT model. |
extrapolation |
a character string giving the type of the extrapolation method, the default is set to be linear extrapolation. |
ylimit |
the y limits of the plot. |
Details
The green points are the average of estimates of B iteration for each labmda.
The linear extrapolation curve is in blue, the corresponding SIMEX estimate is the solid red circle.
The quadratic extrapolation curve is in red, the corresponding SIMEX estimate is the solid blue circle.
The "both" option of the extrapolation method gives both linear and quadratic extrapolation curves.
Author(s)
Juan Xiong, Wenqing He and Grace Y. Yi
See Also
Examples
###########example for the dataset with known variance.################
library("simexaft")
library("survival")
data("BHS")
dataset <- BHS
dataset$SBP <- log(dataset$SBP-50)
set.seed(120)
formula <- Surv(SURVTIME,DTHCENS)~SBP+CHOL+AGE+BMI+SMOKE1+SMOKE2
ind <- c("SBP", "CHOL")
err.mat <- diag(rep(0.5625, 2))
### fit an AFT model with quadratic extrapolation
out2 <- simexaft(formula = formula, data = dataset, SIMEXvariable = ind,
repeated = FALSE, repind = list(), err.mat = err.mat, B = 50,
lambda=seq(0, 2, 0.1),extrapolation="quadratic", dist="weibull")
summary(out2)
plotsimexaft(out2,"SBP","both",ylimit=c(-3,1))