check_monotonicity | R Documentation |
This function checks if the predicted values from a linear model are monotonically increasing or decreasing across a range of L values for multiple age points.
check_monotonicity(lm_model, pred_data, minRaw, maxRaw)
lm_model |
An object of class 'lm' representing the fitted linear model. |
pred_data |
Matrix with prediction values |
minRaw |
lowest raw score in prediction |
maxRaw |
highest raw score in prediction |
The function creates a prediction data frame using all combinations of the provided L values and age points. It then generates predictions using the provided linear model and checks if these predictions are monotonically increasing or decreasing for each age point across the range of L values.
A named character vector where each element corresponds to an age point. Possible values for each element are 1 for "Monotonically increasing" -1 for "Monotonically decreasing", or 0 for "Not monotonic".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.