Description Usage Arguments Value
View source: R/univariate_models.R
x is the independent variable and v is the response variable for univariate ordinal data. Bin the data by x, and calculate the proportion of observations falling into each ordinal category for each bin.
The input bin_bounds is optional. If it is not provided, 20 evenly spaced bins on the interval min(x) to max(x) are used.
The output is a list containing three variables:
bin_centers – The x-values of the bin centers bin_counts – A matrix with dimenesions num_bins by num_cat giving the counts of the ordinal variable (v) for each bin and category bin_prop – A matrix with dimenesions num_bins by num_cat giving the probabilities of the ordinal variable (v) for each bin and category (a normalized version of bin_counts)
1 | calc_bin_prob(x, v, bin_bounds = NA)
|
x |
The vector of independent variables |
v |
The vector of responses (m-values) |
bin_bounds |
(Optional) The bounds to use for binning. If not given, 20 evenly spaced bins on the interval min(x) to max(x) are used. |
A list with the bin centers, bin counts, and bin proportions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.