createZMatrix: Specify a Hierarchical Effect in Terms of a Transformation...

View source: R/h.R

createZMatrixR Documentation

Specify a Hierarchical Effect in Terms of a Transformation Matrix

Description

Function that takes a hierarchical effect variable (as used as a variable in the h function) and creates a transformation matrix that links a vector of random effects to the data

Usage

createZMatrix(var, centreCovs = FALSE, scaleCovs = FALSE, effName = NULL)

Arguments

var

The variable around which the hierarchical effect will be defined. This can be a data.frame, matrix, or a vector containing the different levels to define the effect over.

centreCovs

A logical scalar denoting whether the fixed effects in the model should be centred before the analysis: each covariate element is subtracted by its mean. centreCovs can also be a function with one argument that is a vector of covariate values. In this case the variable is instead centred around the output of this function.

scaleCovs

A logical scalar denoting whether the fixed effects in the model should be scaled before the analysis: each covariate element is divided by its standard deviation. scaleCovs can also be a function with one argument that is a vector of covariate values. In this case the variable is instead scaled around the output of this function.

effName

A character scalar giving a name for the hierarchical effect being defined and used as name for the appropriate nodes

Value

A matrix object containing the transformation matrix

Author(s)

Joseph D. Chipperfield, joechip90@googlemail.com

See Also

h


joechip90/PaGAn documentation built on April 17, 2025, 4:05 p.m.