% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RepeatSHARP.R
\name{RepeatSHARP}
\alias{RepeatSHARP}
\title{Implement SHARP test repeatedly on a dose-response curve}
\usage{
RepeatSHARP(df, nRep, mixed = FALSE, xName, yName, rName, niter = 1000)
}
\arguments{
\item{df}{Dose-response curve data in a table format. Dose and responses should be two separate columns with numeric values.}

\item{nRep}{Number of repetitions of SHAPR test. Integer.}

\item{mixed}{Logical indicator (TRUE for FALSE) for whether or not to use the mixed-model-based test.}

\item{xName}{The column name for dose. Character string.}

\item{yName}{The column name for response. Character string.}

\item{rName}{The column name for random effect. Only used if mixed = TRUE. Character string.git a}

\item{niter}{An integer for the number of iterations in SHARP test procedure}
}
\value{
A dataframe of test results from all repititions. Each row is one single test with four p values after Holm adjustment.
}
\description{
The SHARP shape detection test relies on a underlying random generation process, which may lead to ambiguous test results. To examin its uncertainty and obtain a more robust conclusion, we may with to repet the test on the same data.
}
\examples{
# Simulate dose-response data
x <- seq(0, 1, length.out = 48)
y <- 2*sqrt(x)+rnorm(48)
y[17:32] <- y[17:32]+0.5
y[33:48] <- y[33:48]+1
curve <- data.frame(x, y)
curve$rep <- rep(1:3, each = 16)

# Fixed-model based test
RepeatSHARP(curve, nRep = 10, xName = "x", yName = "y", niter = 10)

# Mixed-model based test
RepeatSHARP(curve, nRep = 10, mixed = TRUE, xName = "x", yName = "y", rName = "rep", niter = 10)
}
