% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/survey_design.R
\name{svyprop}
\alias{svyprop}
\title{Weighted proportion estimation with 95\% CI}
\usage{
svyprop(formula, design, by = NULL, na.rm = TRUE)
}
\arguments{
\item{formula}{A formula (e.g., \code{~variable} or using binary variables).}

\item{design}{A survey design object (from \code{\link[=setup_survey_design]{setup_survey_design()}}).}

\item{by}{Optional formula for stratification (e.g., \code{~sex}).}

\item{na.rm}{Logical; if TRUE (default), omit NA values.}
}
\value{
A data frame with columns:
\itemize{
\item \code{estimate}: estimated proportion (\%)
\item \code{lower}: 95\% CI lower bound (\%)
\item \code{upper}: 95\% CI upper bound (\%)
\item \code{se}: standard error (\%)
\item If \code{by} is specified: grouping column(s) prepended
}
}
\description{
Calculates weighted proportions (as percentages) with 95\% confidence
intervals for a yes/no variable, optionally stratified by a grouping
variable.
}
