CategorModel: R6 class for fitting and predicting joint probability for a univariate categorical summary A[j]
Description
This R6 class defines and fits a conditional probability model P(A[j]|W,...) for a univariate
categorical summary measure A[j]. This class inherits from GenericModel class.
Defines the fitting algorithm for a regression model A[j] ~ W + ....
Reconstructs the likelihood P(A[j]=a[j]|W,...) afterwards.
Categorical A[j] is first redefined into length(levels) bin indicator variables, where
levels is a numeric vector of all unique categories in A[j].
The fitting algorithm estimates the binary regressions for hazard for each bin indicator, Bin_A[j][i] ~ W,
i.e., the probability that categorical A[j] falls into bin i, Bin_A[j]_i,
given that A[j] does not fall in any prior bins Bin_A[j]_1, ..., Bin_A[j]_{i-1}.
The dataset of bin indicators (BinA[j]_1,...,BinA[j]_M) is created
inside the passed data or newdata object when defining length(levels) bins for A[j].
Details
reg - .
outvar - .
levels - .
nbins - .