rescale_binary: Rescale binary covariates as appropriate for edstan models

View source: R/prepare.R

rescale_binaryR 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)

edstan documentation built on April 4, 2025, 12:07 a.m.