Draws the Bland-Altman plot. The differences among pair of data from the same subject
is represented on y-axis. The mean of data from the same subject is represented
on x-axis. Additionally, a bar plot with the proportions of differences
can be drawn.
Usage
plot_BA(data, y, id, rm = NULL, type = c("BA", "bars"))
Value
A list with the following components:
plot. An object of class ggplot. The plot generated.
data. An object of class dataframe that contains the data used to generated the plot.
Arguments
data
A data frame containing at least two columns: outcome and subject identifier.
y
Character string indicating the name of the outcome column in the data set.
id
Character string indicating the name of the subjects column in the data set.
rm
Optional. Character string indicating the name of column that stands for the repeated measurements from the same subjects in the dataset.
Only needed to identify the differences in the Bland-Altman plot.
type
Character. Which plot has to be drawn? Default option is Bland-Altman plot ("BA" option). Alternatively, the bar plot of the proportion of the differences can be created ("bars" option).