# Example 1
# Plot AIC-values and potential cutpoints of the estimation process
# Create AIC values:
AIC_values <- c(1950:1910, 1910:1920, 1920:1880, 1880:1920)
AIC_values <- round(AIC_values + rnorm(length(AIC_values),
mean = 0, sd = 5), digits = 2)
# Create a cutpoint variable:
cpvariable_values <- matrix(NA, nrow = length(AIC_values), ncol = 2)
cpvariable_values[ ,1] <- c(1:length(AIC_values))
# Create a cutpoint object (cpobj):
cpobj <- list(AIC_values = AIC_values,
nb_of_cp = 1,
cpvariable_values = cpvariable_values,
cpvarname = "Cutpoint variable"
)
cp_value_plot(cpobj, plotvalues = "AIC", dp.plot = 2, show_limit = TRUE)
# \donttest{
# Example 2
# Splines plot based on data1
# The data set data1 is included in this package
cpobj <- cp_est(
cpvarname = "biomarker",
covariates = c("covariate_1", "covariate_2"),
data = data1,
nb_of_cp = 2,
plot_splines = TRUE,
)
# Example 3
# Contour plot based on data1
# The data set data1 is included in this package
cpobj <- cp_est(
cpvarname = "biomarker",
covariates = c("covariate_1", "covariate_2"),
data = data1,
nb_of_cp = 2,
plot_splines = FALSE,
)
cp_value_plot(cpobj, plotvalues = "AIC", plottype2cp = "contour")
# }
Run the code above in your browser using DataLab