add_variables: Add variables to the analysis

Description Usage Arguments Value Examples

View source: R/add_variables.R

Description

While different analyses use different types of variables, in general they can be classified as in the 'y' or 'x' position of a statistical equation. They can further be classified as covariates and as an interaction term.

Usage

1
2
3
4
5
add_variables(
  data,
  type = c("yvars", "xvars", "covariates", "interaction"),
  variables
)

Arguments

data

The blueprint data object.

type

The variable type, i.e. where it is located on the equation (y position, x, as a covariate, etc.)

variables

Variables to use for the type specified

Value

Adds variables to the blueprint

Examples

1
2
3
4
5
6
7
8
9
library(magrittr)
ds <- design(iris, 'cor') %>%
 add_settings()
add_variables(ds, 'xvar', 'Sepal.Length')
add_variables(ds, 'yvar', 'Petal.Length')

ds <- design(iris, 't.test')
ds <- add_variables(ds, 'yvar', c('Sepal.Length', 'Sepal.Width'))
ds <- add_variables(ds, 'xvar', 'Petal.Length')

mason documentation built on July 1, 2020, 5:48 p.m.