View source: R/core_functions.R
plot_BA | R Documentation |
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.
plot_BA(data, y, id, rm = NULL, type = c("BA", "bars"))
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). |
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.
plot_BA(EPP,y="Social",id="id")
plot_BA(EPP,y="Social",id="id",rm="Year")
plot_BA(EPP,y="Social",id="id",type="bars")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.