hierlm: Fit an hierarchical model

Description Usage Arguments Details Value Examples

Description

Interpret a hierarchical formula and fit it with the given data and weight ratios.

Usage

1
2
hierlm(formula, datas, ratios = NA, weights = NA, return = "fit",
  verbose = "none", sep = "")

Arguments

formula

an hierlm-style formula

datas

a data frame or a list of data frames, for each lm-style formula contained in the hierlm

ratios

a vector of ratios for the effect of fictional observations, with length as large as the number of hyper expressions.

weights

a vector of weights for fictional observations (overrides ratios)

return

what value to return. Possible values are 'fit' (the fitted model), 'data' (the final data frame), and 'formula' (the final formula)

verbose

what to report. Possible values are 'none', 'weight', 'extras', and 'final'

sep

a paste separator for creating factor and hyper terms

Details

hierlm() takes a formula which could consist of multiple parts, and one or more data.frames to provide fitting data for any of those parts with dependent variables.

Each part of the hierlm formula takes one of the following forms: y ~ ... : an lm-style formula; the left-hand-side variables much match f - b : A requirement that two variables be close together (typically one is a factor) f - . : A requirement that a variable (or set of factors) be close to a new hyper-variable a : f - [b or .] : A requirement that the results of an interaction be near a hyper-variable a : f > b : f : A requirement that one interaction is close to another set of interactions, with the lhs as the strict supersets fa == fb : A requirement that individual coefficients for factor levels are similar.

Value

A fitted lm model

Examples

1
2
3
hierlm(Sepal.Length ~ 0 + Petal.Length + Species + Sepal.Width : Species | Species - ., iris, 1)
hierlm(Sepal.Length ~ 0 + Petal.Length + Species + Sepal.Width : Species |
  Sepal.Width : Species - ., iris, 2)

jrising/hierlm documentation built on May 31, 2019, 8:08 a.m.