rescale_binary {edstan}R Documentation

Rescale binary covariates as appropriate for edstan models

Description

This function rescales a covariate to have a mean of zero and range (maximum - minimum) of one

Usage

rescale_binary(x)

Arguments

x

A numeric vector, matrix, or data frame

Value

A numeric vector, matrix, or data frame with rescaled covariates having mean of zero and range (maximum - minimum) of one.

Examples

vec <- c(1, 3, 1, 3, 1)
rescale_binary(vec)

mat <- matrix(c(1, 3, 1, 3, 1), nrow = 5, ncol = 5)
rescale_binary(mat)

[Package edstan version 1.1.0 Index]