expirest (version 0.1.6)

get_segments: Prepare segments explaining graphical elements

Description

The function get_segments() prepares a data frame for putting segments on a plot prepared by the ggplot() function from the ‘ggplot2’ package.

Usage

get_segments(model, x_range, rl_index, mtbs = "verified")

Value

A data frame with the columns ‘Time.1’, ‘Time.2’, ‘Response.1’, ‘Response.2’, Item, Colour, Type and Size is returned, where the column names ‘Time.1’, ‘Time.2’, ‘Response.1’ and ‘Response.2’ are placeholders for the corresponding variable names. The items in the four rows represent the maximal allowed difference over time from the intercept (shown as red dashed horizontal line), the release limit (shown as black dotted horizontal line), the maximal allowed difference over time from the specification limit (shown as grey solid vertical line) and the maximal allowed difference over time from the intercept (shown as grey solid vertical line).

Arguments

model

An ‘expirest_osle’ or an ‘expirest_Wisle’ object, i.e. a list returned by the expirest_osle() or by the expirest_wisle() function.

x_range

A numeric vector of the form c(min, max) that specifies the range of the time variable to be plotted.

rl_index

A positive integer that specifies which of the release limit values that have been handed over to expirest_wisle() should be displayed. The default is NULL.

mtbs

A character string that specifies the “model to be shown”, i.e. either verified, which is the default, or one of cics, dics, dids or dids.pmse. The verified model is the model that was identified through the poolability check. It is thus also one of the possible optional models. The dids model represents the case where a separate model is fitted to the data of each individual batch while the dids.pmse model is the interaction model which includes the \(batch\) variable as main effect and in the interaction term with the \(time\) variable (\(batch \times time\)), i.e. a model where the mean square error is pooled across batches.

Details

The function get_segments() expects various pieces of information characterising an ‘expirest_osle’ or an ‘expirest_wisle’ model. Based on the information provided, the function prepares a data frame that that is used by the function plot_expirest_wisle()) to put line segments on the graph that is prepared by this function.

See Also

plot_expirest_osle, plot_expirest_wisle, ggplot, geom_text.