Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

squeeze

Squeeze the imputed values to be within specified boundaries.


Description

This function replaces any values in x that are lower than bounds[1] by bounds[1], and replaces any values higher than bounds[2] by bounds[2].

Usage

squeeze(x, bounds = c(min(x[r]), max(x[r])), r = rep.int(TRUE, length(x)))

Arguments

x

A numerical vector with values

bounds

A numerical vector of length 2 containing the lower and upper bounds. By default, the bounds are to the minimum and maximum values in x.

r

A logical vector of length length(x) that is used to select a subset in x before calculating automatic bounds.

Value

A vector of length length(x).

Author(s)

Stef van Buuren, 2011.


mice

Multivariate Imputation by Chained Equations

v3.13.0
GPL-2 | GPL-3
Authors
Stef van Buuren [aut, cre], Karin Groothuis-Oudshoorn [aut], Gerko Vink [ctb], Rianne Schouten [ctb], Alexander Robitzsch [ctb], Patrick Rockenschaub [ctb], Lisa Doove [ctb], Shahab Jolani [ctb], Margarita Moreno-Betancur [ctb], Ian White [ctb], Philipp Gaffert [ctb], Florian Meinfelder [ctb], Bernie Gray [ctb], Vincent Arel-Bundock [ctb]
Initial release
2021-01-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.