varkernelslice: Estimated outcome variable values given the influencing...

View source: R/varkernelslice.R

varkernelsliceR Documentation

Estimated outcome variable values given the influencing variable, based on a slice of 'z' from the kernel density plot of the variable and out_var data.

Description

Plot representing probabilities (shown along the y-axis) for the expected value of the outcome variable (shown along the x-axis). This is a cut through the density kernel from uncertainty::varkernel() function, which integrates to 1, the probability values are relative, not absolute measures.

Usage

varkernelslice(
  in_var,
  out_var,
  expectedin_var,
  n = 100,
  ylab = "Relative probability",
  xlab = "Output values for the given influence variable values"
)

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.

expectedin_var

is the expected value of the input variable for which the outcome variable out_var should be estimated.

n

is the number of grid points in each direction. Can be scalar or a length-2 integer vector (passed to the kde2d kernel density function of the MASS package).

ylab

is a label for the relative probability along the cut through the density kernel on the y axis, the default label is "Relative probability".

xlab

is a label for the influencing variable in_var on the x axis, the default label is "Influencing variable".

Examples

in_var <- sample(x = 1:50, size = 20, replace = TRUE)
out_var <- sample(x = 1000:5000, size = 20, replace = TRUE)
varkernelslice(in_var, out_var, expectedin_var = 10)


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