\HeaderA{ei.reg.bayes}{Ecological regression using Bayesian Normal regression}{ei.reg.bayes}
\keyword{models}{ei.reg.bayes}
\begin{Description}\relax
Estimate an ecological regression using Bayesian normal 
regression.
\end{Description}
\begin{Usage}
\begin{verbatim}
ei.reg.bayes(formula, data, sample = 1000, weights = NULL, truncate=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{formula}] An R formula object of the form \code{cbind(c1, c2, ...)
    \textasciitilde{} cbind(r1, r2, ...)}
\item[\code{data}] data frame containing the variables specified in formula
\item[\code{sample}] number of draws from the posterior
\item[\code{weights}] a vector of weights
\item[\code{truncate}] if TRUE, imposes a proper uniform prior on the unit
hypercube for the coefficients; if FALSE, an improper uniform prior is assumed
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For \eqn{i \in 1,\ldots,C}{}, \eqn{C}{} Bayesian regressions
of the form \code{c\_i \textasciitilde{} cbind(r1, r2, ...)} are
performed.  See the documentation for \code{ei.reg} for the accounting
identities and constancy assumption underlying this Bayesian linear
model.

The sampling density is given by \deqn{y|\beta, \sigma^2, X \sim
N(X\beta, \sigma^2 I)}{}

The improper prior is \eqn{p(\beta,\sigma^2|X)\propto
\sigma^{-2}}{}.

The proper prior is \eqn{p(\beta, \sigma^2|x) \propto I(\beta \in
[0,1])\times \sigma^{-2}}{}.
\end{Details}
\begin{Value}
A list containing 
\begin{ldescription}
\item[\code{call}] the call to \code{ei.reg.bayes}
\item[\code{draws}] A, \eqn{R \times C \times}{} sample array containing
posterior draws for each population cell fraction
\end{ldescription}
\end{Value}
\begin{Author}\relax
Olivia Lau \textless{}\email{olivia.lau@post.harvard.edu}\textgreater{} and Ryan T. Moore \textless{}\email{rtm@wustl.edu}\textgreater{}
\end{Author}
\begin{References}\relax
Leo Goodman. 1953. ``Ecological Regressions and the Behavior of Individuals.''
\emph{American Sociological Review} 18:663--664.
\end{References}

