removeAllMissingCatVar: A function to remove categorical variables with insufficient...

View source: R/removeAllMissingCatVar.R

removeAllMissingCatVarR Documentation

A function to remove categorical variables with insufficient data to estimate effects from mixture models

Description

This function removes categorical variables from mixture models. This is needed when metabolite values are entirely missing or only present for one level of the categorical variable, making it impossible to estimate effects for the categorical variable.

Usage

removeAllMissingCatVar(cat.varname,  mxtrModel)

Arguments

cat.varname

A character string indicating a categorical predictor variable in the mixture model.

mxtrModel

A mixture model formula of class formula.

Value

Returns a mixture model formula of class formula with the variable indicated in cat.varname omitted.

Author(s)

Michael Nodzenski

Examples


#specifiy mixture model 
mix.model<- ~ var1 + var2 | var1 + var2

#remove var1 
removeAllMissingCatVar("var1", mix.model)


mnodzenski/metabomxtr documentation built on Aug. 24, 2022, 1:40 p.m.