predictOrdinal: Calculates the predicted probabilities (from an ordinal...

View source: R/Models.R

predictOrdinalR Documentation

Calculates the predicted probabilities (from an ordinal regression model) to be in each cateory for a three or more level categorical variable.

Description

Calculates the predicted probabilities (from an ordinal regression model) to be in each cateory for a three or more level categorical variable.

Usage

predictOrdinal(models, numchildren, envir = parent.frame(), stochastic = FALSE)

Arguments

models

A list of models - one for each category. The difference in the models will only be the intercept if the model is an ordinal multinomial regression (clogit in SAS).

numchildren

number of units

envir

environment in which to evaluate model variables.

stochastic

If TRUE adds random variation around the probabilities to be in each category. If TRUE it will cause the probabilities to no longer add to 1 and so should only be used when the probabilities are being used as propensities in scenario testing.

Value

A matrix of probabilities. Rows correspond to individual units (children) and columns correspond to the categories of the variable. The probabilities will add to 1 and be the exact probabilities estimated from the model if stocahtic=FALSE, otherwise, if stochastic=TRUE, they will approximate probabilities that will most likely not add to 1 and could also be negative or greater than 1.


kcha193/simarioV2 documentation built on April 8, 2024, 4:51 p.m.