View source: R/varkernelslice.R
varkernelslice | R Documentation |
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.
varkernelslice( in_var, out_var, expectedin_var, n = 100, ylab = "Relative probability", xlab = "Output values for the given influence variable values" )
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". |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.