Newer
Older
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitmodel.R
\name{drop_randfx}
\alias{drop_randfx}
\title{Drop Random Effects from a Formula}
\usage{
drop_randfx(form)
}
\arguments{
\item{form}{The formula from which random effects should be dropped.}
}
\value{
A modified formula with specified random effects dropped.
}
\description{
This function allows you to remove random effects from a formula by specifying
which terms to drop. It checks for the presence of vertical bars ('|') in the
terms of the formula and drops the random effects accordingly. If all terms
are random effects, the function updates the formula to have only an intercept.
}
\examples{
# Create a formula with random effects
formula <- y ~ x1 + (1 | group) + (1 | subject)
# Drop the random effects related to 'group'
modified_formula <- drop_randfx(formula)
}