% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/p_wilcox.test.r
\name{p_wilcox.test}
\alias{p_wilcox.test}
\title{Conducts Wilcoxon rank-sum tests, with support for piping}
\usage{
p_wilcox.test(data, x = NULL, y = NULL, formula = NULL, ...)
}
\arguments{
\item{data}{the data}

\item{x}{one of two variables}

\item{y}{one of two variables}

\item{formula}{a formula}

\item{...}{additional arguments passed to \code{\link[stats:wilcox.test]{stats::wilcox.test()}}.}
}
\value{
an \code{htest} object
}
\description{
A wrapper function for \code{wilcox.test()}, with the \code{data} argument listed first to support piping.
}
\examples{
# load the data
data(nhanes)

# define smoking
nhanes<-nhanes |> transform(
  smoking=base_match(smq020,'No'=2,'History of smoking'=1)
)

# conduct a one-sample wilcoxon test
nhanes |> p_wilcox.test(bpxosy1)

# conduct a two-sample wilcoxon test, using formula notation
nhanes |> p_wilcox.test(bpxosy1~smoking)

# conduct a two-sample wilcoxon test, using formula notation
nhanes |> p_wilcox.test(formula=bpxosy1~smoking)

# conduct a paired wilcoxon test, using x and y
nhanes |> p_wilcox.test(bpxosy1,bpxosy2,paired=TRUE)
}
