predSimModSelect: Predict and simulate value from n models.

View source: R/Models.R

predSimModSelectR Documentation

Predict and simulate value from n models.

Description

Models can be normal or negative binomial. Normal models include the truncation that is described in predSimNormsSelect(). I.e. any simulated values outside the binbreaks for the group are truncated to the limits for their gorup. Negative binomial models assume that only the last category will have a negative binomial model and the simulated values are backtransformed by adding the start value of the last cateogory. E.g. if the last category is 5+, then 5 is added to any values simulated from a negative binomial distribution.

Usage

predSimModSelect(
  x.cat,
  models,
  cont.binbreaks,
  logiset = NULL,
  envir = parent.frame()
)

Arguments

x.cat

a categorical vector

models

a list of models with length equal to the number of categories in x.cat

cont.binbreaks

the binbreaks of the categorical variable

logiset

logical vector indicating which observations to include, or NULL to include all.

envir

environment in which to evaluate model variables.

Value

a continuous vector that when binned by cont.bonbreaks will be the same as x.cat envir=.GlobalEnv


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