% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/p_lm.r
\name{p_lm}
\alias{p_lm}
\title{Fits linear models, with support for piping}
\usage{
p_lm(data, formula, ...)
}
\arguments{
\item{data}{the data}

\item{formula}{the formula}

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

# define country
nhanes<-nhanes |> transform(
  country=base_match(dmdborn4,'USA'=1,'Other'=2)
)

# fit a model
my_model<-nhanes |> p_lm(bpxosy1~country)

# obtain model details
my_model |> summary()

# obtain confidence interval
my_model |> confint()
}
