varscatter | R Documentation |
scatter plot of an influencing variable (x) and an outcome variable (y) with associated and estimated densities (using a loess smooth) given by the red dot (mean) and red ellipses (1 and 2 sigma from mean). The red line going across the plot shows the linear fit. Histograms are shown with smooth lines (loess smooth linear fits) density curves. The numeric value in the upper right gives the Spearman correlation coefficient between the influencing variable and the outcome variable.
varscatter( in_var, out_var, xlab = "Influencing variable", ylab = "Outcome variable" )
in_var |
is a vector of observations of a given influencing variable corresponding to another list with observed values of an outcome variable out_var. |
out_var |
is a vector of observed values of an outcome variable corresponding to another list with observations of a given influencing variable in_var. |
xlab |
is a label for the influencing variable in_var on the x axis, the default label is "Influencing variable". |
ylab |
is a label for the outcome variable out_var on the y axis, the default label is "Outcome variable". |
in_var <- sample(x = 1:50, size = 20, replace = TRUE) yield <- sample(x = 1000:5000, size = 20, replace = TRUE) varscatter(in_var, yield)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.