% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lsReg.R
\name{lsReg}
\alias{lsReg}
\title{Allocate memory for large-scale regression}
\usage{
lsReg(basemdl, colstoadd, testtype)
}
\arguments{
\item{basemdl}{Base model of the form \code{y ~ xl}, fitted with \code{glm}.
Must be of family \code{gaussian}, \code{binomial}, or \code{poisson}.}

\item{colstoadd}{Number of columns in \code{xr}. The full model tested will
be \code{y ~ xl + xr}.}

\item{testtype}{Character string specifying the test type. One of
\code{"lrt"} (default), \code{"score"}, \code{"robustscore"},
\code{"wald"}, or \code{"robustwald"}.}
}
\value{
An object of class \code{lsregmem} containing pre-allocated matrices
and cached quantities from the base model, for use with \code{\link{addcovar}}.
}
\description{
Prepares and caches data structures from a fitted base GLM for use in
repeated large-scale hypothesis tests via \code{\link{addcovar}}.
}
\examples{
datafile <- system.file("extdata", "simulated_data.rds", package = "lsReg")
dat <- readRDS(datafile)
basemdl <- glm(ylin ~ x1 + x2, data = dat, family = gaussian)
mem <- lsReg(basemdl, colstoadd = 1, testtype = "wald")
}
