center_variables: center_variables() computes the centered variables for mixed...

View source: R/center_variables.R

center_variablesR Documentation

center_variables() computes the centered variables for mixed models

Description

center_variables() computes the centered variables for mixed models

Usage

center_variables(data, variable, name)

Arguments

data

a data frame with variables id_j (cluster variable), and id_k (higher cluster, e.g., country)

variable

variable to be center

name

acronym for the generated variables

Value

a data frame, including the center variables

Examples

library(dplyr)
data_model %>%
center_variables(data = ., variable = sex , name = sex) %>%
dplyr::glimpse()

dacarras/r4sda documentation built on Nov. 9, 2023, 10:17 a.m.