product_ind: Mean-centered product indicators

Description Usage Arguments Value

Description

Creates mean-centered and/or double-mean-centered product indicators. Additionally centers all variables in data

Usage

1
product_ind(data, vars1, vars2, bind = TRUE, method = c("single", "double"))

Arguments

data

A data frame.

bind

Logical. If TRUE, the centered variables and product indicators are appended to the data frame provided by data. If FALSE, only the product indicators are returned.

method

Character vector with options "single" and "double". If "single" is included, the matched products of vars1 and vars2 are included. If "double" is included, the product indicators are mean centered.

var1, var2

Character vectors naming the variables to be multiplied together.

Value

A data frame. If bind = TRUE, all centered variables of data and all product indicators are appended to the the original data frame. The merged data frame is returned. If bind = FALSE, only the centered variables and product indicators are returned in a data frame.


jaydennord/nord-package documentation built on May 18, 2019, 5:57 p.m.