plot_frailty_sd | R Documentation |
This function generates a plot of either the frailty standard deviation or the frailty variance for the intervals in the time-domain.
plot_frailty_sd(
result,
flag_full = TRUE,
flag_variance = FALSE,
xlim = c(min(result$TimeDomain), max(result$TimeDomain)),
ylim = NULL,
xlab = "Time",
ylab = "Values",
main = NULL,
pch = 21,
color_bg = "blue",
cex_points = 0.7
)
result |
An S3 object of class 'AdPaik', returned by the main model call 'AdPaikModel(...)'. |
flag_full |
A boolean flag indicating whether to plot the full standard deviation ( |
flag_variance |
A boolean flag indicating whether to plot the frailty variance ( |
xlim |
A numeric vector specifying the range for the x-axis (intervals). If NULL, default is set to the interval min-max of the time-domain. |
ylim |
A numeric vector specifying the range for the y-axis (intervals). If NULL, default is 0 to the maximum value of the frailty variance/standard deviation. |
xlab |
A string for the x-axis label. Default is |
ylab |
A string for the y-axis label. Default is |
main |
A string for the plot title. Default title is |
pch |
A numeric or character symbol used for plotting the frailty standard deviation values. Default is a dot ( |
color_bg |
A string specifying the color used for the symbols. Default is |
cex_points |
A numeric value indicating the size of the plotting symbols. Default is |
The plot represents the values of the frailty standard deviation or variance for each time interval (represented by its mid point). It connects these points to illustrate the trend of the chosen metric.
This function supports plotting the full or only time dependent frailty standard deviation or variance retrieved from the main model (contained in the S3 object of class 'AdPaik').
A plot displaying either the frailty standard deviation or variance across the specified intervals.
# Import data
data(data_dropout)
# Define the variables needed for the model execution
eps_paik <- 1e-10
categories_range_min <- c(-8, -2, eps_paik, eps_paik, eps_paik)
categories_range_max <- c(-eps_paik, 0.4, 1 - eps_paik, 1, 10)
time_axis <- c(1.0, 1.4, 1.8, 2.3, 3.1, 3.8, 4.3, 5.0, 5.5, 5.8, 6.0)
formula <- time_to_event ~ Gender + CFUP + cluster(group)
# Call the main model function
result <- AdPaikModel(formula, data_dropout, time_axis, categories_range_min, categories_range_max)
plot_frailty_sd(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.