% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/skeleton_build.R
\name{skeletion_build}
\alias{skeletion_build}
\alias{skeleton_build}
\title{Fit the stepwise “skeleton” model for joint mapping}
\usage{
skeletion_build(
  formula,
  data,
  type = "linear",
  strategy = "bidirection",
  metric = "SL",
  include = NULL,
  cut_off_list
)

skeleton_build(
  formula,
  data,
  type = "linear",
  strategy = "bidirection",
  metric = "SL",
  include = NULL,
  cut_off_list
)
}
\arguments{
\item{formula}{A model formula (same as used in \code{\link{permutation_test}}).}

\item{data}{A data frame containing all variables in \code{formula}.}

\item{type}{Model type passed to \code{StepReg::stepwise()}. Default is
\code{"linear"}.}

\item{strategy}{Stepwise strategy, for example \code{"forward"},
\code{"backward"}, or \code{"bidirection"}. Default is \code{"bidirection"}.}

\item{metric}{Information criterion or selection metric in StepReg, for
example \code{"SL"}. Default is \code{"SL"}.}

\item{include}{Optional character vector of terms to keep in the stepwise
search, passed to \code{StepReg::stepwise()}. Default is \code{NULL}.}

\item{cut_off_list}{A list with a component \code{cut_off} that includes a
named entry \code{"pvalue"} (for example, the return value of
\code{\link{permutation_test}}). This value is used for both \code{sle} and
\code{sls} in the stepwise call.}
}
\value{
The best model object for the chosen \code{strategy} and
  \code{metric} (an element of the \code{StepReg::stepwise()} result,
  typically with a \code{call} and \code{call$formula}).
}
\description{
Runs \code{StepReg::stepwise()} with entry/stay levels set from a permutation
p-value threshold, and returns the selected best linear model. The result is
typically passed to \code{\link{joint_map}()} as the \code{skeleton} argument.
}
\seealso{
\code{\link{joint_map}}, \code{\link{permutation_test}}
}
