% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SharpScatter.R
\name{SharpScatter}
\alias{SharpScatter}
\title{Function to visualize SHARP test results}
\usage{
SharpScatter(
  pinc,
  pdec,
  pconc,
  pconv,
  alpha = 0.05,
  scale = TRUE,
  label = NULL,
  size_point = 2,
  size_label = 5,
  ...
)
}
\arguments{
\item{pinc, pdec, pconc, pconv}{SHARP test p-values corresponding to increasing, decreasing, concave and convex}

\item{alpha}{significance threshold. alpha=NULL corresponding to no significance threshold}

\item{scale}{if the axis should be scale so that the significant threshold is placed in the center}

\item{label}{labels of the point to visualize. label=NULL means no labeling.}

\item{size_point, size_label}{the size of points and label. size_lable is used when label is not NULL.}

\item{...}{additional parameters passed to ggplot}
}
\value{
The plotted ggplot object
}
\description{
Function to visualize SHARP test results
}
\details{
The shape scatter plot represents the four p-values (corresponding to four shape types) of SHARP test on a 2D space.
it can not only visualize the conclusions of the test, but also the confidence level of the test.
The plot surface is divided into two parts along two perpendicular directions, corresponding to two opposite shapes.
The coordinates of points are derived from p-values such that:
\itemize{
\item Inconclusive shapes are placed in the center area within the significance thresholds (p > 0.05)
\item Significant shapes are placed in the edge area out of the significance thresholds (p < 0.05)
\item The closer points are to the significance thresholds, the more ambiguous shape conclusion is
}
}
\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
sharpt <- SHARPtest(curve, xName = "x", yName = "y", niter = 100)

# Plot the graph
SharpScatter(sharpt[1], sharpt[2], sharpt[3], sharpt[4], niter = 100)
}
