Learn R Programming

edstan (version 1.1.0)

rescale_binary: 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)

Value

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

Arguments

x

A numeric vector, matrix, or data frame

Examples

Run this code
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)

Run the code above in your browser using DataLab