Learn R Programming

AccelStab (version 2.3.1)

step1_plot_PI: Plot Prediction Intervals

Description

Plot the stability data and visualise the predictions with prediction intervals.

Usage

step1_plot_PI(
  step1_down_object,
  xname = NULL,
  yname = NULL,
  xlim = NULL,
  ylim = NULL,
  ribbon = FALSE
)

Value

Plot of stability data with prediction curves and prediction intervals.

Arguments

step1_down_object

The fit object from the step1.down function (required).

xname

Label for the x-axis (optional).

yname

Label for the y-axis (optional).

xlim

x-axis limits (optional).

ylim

y-axis limits (optional).

ribbon

Add shade to prediction intervals (optional).

Details

Use the fit object obtained from the step1.down function to plot the stability data and visualise the predictions with prediction intervals applied. There is an option to view the prediction intervals as a ribbon. The prediction interval value is chosen in the step1.down function.

Examples

Run this code
#Load antigenicity data
data(antigenicity)

#Run step1.down fit
fit1 <- step1_down(data = antigenicity, y = "conc", .time = "time",
 C = "Celsius", max_time_pred = 3)

#Plot raw data with prediction curves and prediction intervals.
step1_plot_PI(step1_down_object = fit1, xlim = NULL, ylim = NULL,
 xname = "Time (Years)", yname = "Concentration", ribbon = TRUE)

#Plot raw data with prediction curves and confidence intervals.
#Also limit x-axis to values between 0 and 1.5 and limit y-axis to values between 0 and 105.
step1_plot_PI(step1_down_object = fit1, xlim = c(0,1.5), ylim = c(0,105),
 xname = "Time (Years)", yname = "Concentration", ribbon = TRUE)

Run the code above in your browser using DataLab