MakeHierFormula: Make model formula from data taking into account hierarchical...

View source: R/MakeHierFormula.R

MakeHierFormulaR Documentation

Make model formula from data taking into account hierarchical variables

Description

Make model formula from data taking into account hierarchical variables

Usage

MakeHierFormula(
  data = NULL,
  hGroups = HierarchicalGroups2(data),
  n = length(hGroups),
  sim = TRUE
)

Arguments

data

data frame

hGroups

Output from HierarchicalGroups2()

n

Interaction level or 0 (all levels)

sim

Include "~" when TRUE

Value

Formula as character string

Author(s)

Øyvind Langsrud

Examples

x <- SSBtoolsData("sprt_emp_withEU")[, -4]
MakeHierFormula(x)
MakeHierFormula(x, n = 2)
MakeHierFormula(x, n = 0)

SSBtools documentation built on Oct. 30, 2024, 5:09 p.m.