varscatter: Create a scatter plot of a given influencing variable and an...

View source: R/varscatter.R

varscatterR Documentation

Create a scatter plot of a given influencing variable and an outcome variable

Description

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.

Usage

varscatter(
  in_var,
  out_var,
  xlab = "Influencing variable",
  ylab = "Outcome variable"
)

Arguments

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".

Examples

in_var <- sample(x = 1:50, size = 20, replace = TRUE)
yield <- sample(x = 1000:5000, size = 20, replace = TRUE)
varscatter(in_var, yield)


CWWhitney/uncertainty documentation built on June 14, 2022, 10:21 p.m.