View source: R/ordinal-methods.R
| simulate.fastglm_ordinal | R Documentation |
Generates independent categorical observations conditional on the retained predictors and offsets. Frequency rows are simulated as multinomial counts, so a frequency of ten generates ten observations at that predictor row.
## S3 method for class 'fastglm_ordinal'
simulate(object, nsim = 1L, seed = NULL, ...)
object |
a converged |
nsim |
number of simulated response datasets, a positive integer. |
seed |
optional random seed. When supplied, the caller's random-number state is restored on exit. |
... |
further arguments; currently unused. |
The original category labels and their order are preserved.
A collapsed category has fitted probability zero and therefore simulated
count zero. This is simulation from the fitted distribution; it does not
quantify uncertainty about a category absent from that distribution.
Row totals are effective frequencies, including counts times fitting
weights, and must not exceed .Machine$integer.max.
Rows omitted under na.exclude are restored with missing values.
For an individual response with unit frequency in every retained row, a data frame of ordered factors, one column per simulation. Otherwise a named list of count matrices, one per simulation, with rows matching the fitted design and columns in the declared category order. Count matrices already include the fitting frequencies and should be refitted with unit weights. They are not counts to which the original weights are reapplied.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.