% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GxEScanR.R
\name{gweis.mem}
\alias{gweis.mem}
\title{Routine to allocate memory needed to perform a GWEIS.}
\usage{
gweis.mem(gemdl, subids, tests, gomdl = NULL)
}
\arguments{
\item{gemdl}{The results from glm for the gene-environment model. This model
contains the outcome and all covariates of interest with the last covariate
listed in the model being the covaraiate that the gene interaction is being
tested for.}

\item{subids}{A character vector of subject IDs that line up with the
data that was used in the models that are passed to this routine}

\item{tests}{The list of tests to perform. These can be any combination of
the following values "bg_go", "bg_ge", "bg_gxe", "bgxe", "joint", "bg_eg",
"bg_case", "bg_ctrl"}

\item{gomdl}{The results from glm for the gene-only model. This model
contains the outcome and all the covariates except the covariate that
the gene interaction is being tested for. Required (non-NULL) when
\code{"bg_go"} is included in \code{tests}; ignored otherwise.}
}
\value{
List containing allocated memory to perform the specified GWEIS.
This value is passed to the \code{rungweis} routine. Returns \code{1} if
any value in \code{tests} is not a recognised test name.
}
\description{
Routine to allocate memory needed to perform a GWEIS.
}
\examples{
\dontrun{
bdinfo <- BinaryDosage::getbdinfo(system.file("extdata", "gendata.bdose",
                                              package = "GxEScanR"))
subdata <- readRDS(system.file("extdata", "subdata.rds", package = "GxEScanR"))
subdata <- subdata[complete.cases(subdata), ]
subdata <- subdata[subdata$subid \%in\% bdinfo$samples$sid, ]

linearmodel <- glm(y_linear ~ x2 + x1, data = subdata)
linearmem <- gweis.mem(gemdl = linearmodel,
                       subids = subdata$subid,
                       tests = c("bg_ge", "bg_gxe", "bgxe", "joint"))
}
}
