discretize_from_thresholds | R Documentation |
Discretizes continuous latent goal score values into discrete levels centred at 0, using a set of thresholds.
discretize_from_thresholds(score_continuous, thresholds)
score_continuous |
Numeric vector of continuous goal scores. |
thresholds |
Numeric vector of thresholds separating the goal attainment levels. Must be an even number of thresholds (which corresponds to an odd number of attainment levels) |
Numeric vector, the same length as score_continuous
, of integers
corresponding to discrete attainment levels. For a typical 5-point
attainment scale, the returned values will be of the set
{-2, -1, 0, 1, 2}.
thresh <- create_thresholds() y <- rnorm(10) y_discrete <- discretize_from_thresholds(y, thresh)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.