% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/twoPhase.R
\name{twoPhaseDesign}
\alias{twoPhaseDesign}
\title{Compute sample allocations for a two phase study design.}
\usage{
twoPhaseDesign(
  beta,
  maf_G,
  LD,
  data,
  n2,
  design_formula = Y ~ G + Z,
  family = gaussian(),
  S,
  perc_Y = c(1/5, 4/5),
  p_gz,
  design = c("RDS", "LM", "GA", "PPS", "BAL", "COM", "TZL"),
  ndraws = 10,
  optimCriterion = c("Par-spec", "A-opt", "D-opt"),
  overallMethod = c("med-max", "cumm")
)
}
\arguments{
\item{beta}{Vector of betas (length of 3, corresponding to intercept, effect size for G, effect size for Z).}

\item{maf_G}{minor allele frequency for G (numeric, ranging from 0 to 1). Numeric or vector of possible values.}

\item{LD}{Correlation r betweek G and Z (numeric, ranging from -1 to 1, r value). Numeric or vector of possible values.}

\item{data}{Data frame with Y and Z variables.}

\item{n2}{Phase 2 sample size.}

\item{design_formula}{Formula for the regression model, default is Y ~ G + Z, where Z is the GWAS SNP, G is the sequence variant. Y is outcome. Rename the variables in your data.frame to match Y and Z, G is the seq-SNP not present in the data.frame.}

\item{family}{Distrubution of the outcome. Default: gaussian(). Familes available for glm can be used here. See help(stats::family) for examples.}

\item{S}{stratification of the outcome Y. Optional. Should be a numeric vector with strata categories (e.g. 1 1 2 2 3 3 ). If present, its length must be equal to the number of rows in data. Default: NULL. Needed when Y does not render itself into strata, e.g. Gaussian, Poisson, Gamma.}

\item{perc_Y}{vector of percentiles in increasing order for which the outcome Y will be stratified. Default: c(1/5,4/5). Only used when S is NA. Note that setting up S is strongly suggested.}

\item{p_gz}{data frame with the joint distribution between G and Z. See examples for the right format. Default: NULL. If present, values of maf_G and LD are disregarded in the analysis.}

\item{design}{string for the design to use for phase 2 sample selection. One of residual-dependent sampling ("RDS"), optimal as defined by Tao, Zheng and Lin (2019) ("TZL"), optimal via Lagrange multipliers ("LM"), optimal via genetic algorithm ("GA"), probability proportional to size ("PPS"), balanced ("BAL") or combined ("COM") allocations. Default: "RDS". See details for a more explanations.}

\item{ndraws}{integer that determines the number of draws to examine when design is one of "pps", "bal" or "comb" and the design parameter combinations is greater than 1. Default: 10}

\item{optimCriterion}{string denoting the optimality criterion used during the optimization. One of "Par-spec" (default), "A-opt" or "D-opt". For parameter-specific, A-optimality or D-optimality, respectively.}

\item{overallMethod}{string denoting the method to select the overall design when multiple design parameters are given. One of "med-max" (default) or "cumm" for median-maximum and cummulative frequencies, respectively.

Note that in this version strata are always defined in terms of Z and S, i.e. a joint design, future implementations may relax this by allowing for only S or only Z (marginal designs, outcome- or covariate-dependent, respectively)}
}
\value{
sth
}
\description{
Compute sample allocations for a two phase study design.
}
