predSimNormsSelectWithRounding: Predict and simulate value from n normal models with...

View source: R/Models.R

predSimNormsSelectWithRoundingR Documentation

Predict and simulate value from n normal models with truncation/rounding to ensure simulated values stay within their category bounds.

Description

A function based on PredSimNormsSelect with the modification that if any simulated values are outside the binbreaks for the group, the simulated values are changed to be equal to the boundary value. Use when all the catToCont models for a variable are normal.

Usage

predSimNormsSelectWithRounding(
  x.cat,
  models,
  cont.binbreaks,
  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

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


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