FormatCovariateData: Create the right hand side of a formula with the...

View source: R/FormatCovariateData.R

FormatCovariateDataR Documentation

Create the right hand side of a formula with the specification for the latent variables.

Description

Create the right hand side of a formula with the specification for the latent variables.

Usage

FormatCovariateData(
  X = NULL,
  intercept = FALSE,
  AddTerm = NULL,
  intname = NULL,
  nrows = NULL,
  random = NULL
)

Arguments

X

Covariate data

intercept

Logical, should an explicit intercept be added?

AddTerm

Term to be added, either a name or a character vector of same length as X. If a single name, the values will be 1:nrow(result)

intname

Name of interaction covariate (e.g. if X is supplied, X:column). Defaults to NULL

nrows

Number of rows in the result. This gets superceded by anything else (i.e. X or AddTerm) defining the number of rows. Defaults to NULL.

random

Vector of names of variables to be made random effects. NULL (the default) if none.

Value

A data frame with X, an intercept and added term, if desires, and with an attribute that is the part of the formula needed in the model

Examples

FormatCovariateData(X=cbind(X1=1:5, X2=2:6), intercept=TRUE, AddTerm = "thing")

oharar/LatentINLA documentation built on Sept. 13, 2023, 5:18 p.m.