This function generates a ggplot2 visualization of the distances before and after a vachette transformation between observations and the relative typical curves. It is useful for assessing the impact of additive error model assumption on the distances.

p.add.distances(vachette_data)

Arguments

vachette_data

An object of class vachette_data, which contains the necessary data for plotting.

Value

A ggplot2 object representing the plot of distances. The plot compares the original distances to the transformed distances, with segments color-coded.

Details

The function starts by setting the x-axis range based on the minimum and maximum values of the original and scaled distances. It then plots the distances before and after transformation, with a reference line indicating where the original and transformed distances are equal.

The plot's title includes the model name, and the caption provides details about the reference covariate(s) used.