\HeaderA{lambda.reg}{Calculate shares using data from regression model}{lambda.reg}
\keyword{models}{lambda.reg}
\begin{Description}\relax
Calculates the population share of row members in a particular column
\end{Description}
\begin{Usage}
\begin{verbatim}
lambda.reg(object, columns) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] An R object of class \code{eiReg}, the output from \code{\LinkA{ei.reg}{ei.reg}}
\item[\code{columns}] a character vector of column names to be included in calculating
the shares
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Standard errors are calculated using the delta method as implemented in
the library \code{msm}.  The arguments passed to
\code{deltamethod} in \code{msm} include 
\Itemize{
\item[\code{g}] a list of transformations of the form \code{\textasciitilde{} x1 / (x1 + x2 +
      + ... + xk)}, \code{\textasciitilde{} x2 / (x1 + x2 + ... + xk)}, etc.. Each
\eqn{x_c}{} is the estimated proportion of all row members in column
\eqn{c}{}, \eqn{\hat{\beta}_{rc}}{}
\item[\code{mean}] the estimated proportions of the row members in the
specified columns, as a proportion of the total number of row
members, \eqn{(\hat{\beta}_{r1}, \hat{\beta}_{r2}, ...,
\hat{\beta}_{rk})}{}. 
\item[\code{cov}] a diagonal matrix with the estimated variance of each
\eqn{\hat{\beta}_{rc}}{} on the diagonal.  Each column
marginal is assumed to be independent, such that the off-diagonal
elements of this matrix are zero.  Estimates come from
\code{object\$cov.matrices}, the estimated covariance matrix from
the regression of the relevant column.  Thus,

}
\Tabular{cccccc}{
cov & = & \eqn{Var(\hat{\beta}_{r1})}{} & 0
& 0 & \eqn{\ldots}{} \\ 
& & 0 & \eqn{Var(\hat{\beta}_{r2})}{} & 0 & \eqn{\ldots}{} \\
& & 0 & 0 & \eqn{Var(\hat{\beta}_{r3})}{} & \eqn{\ldots}{} \\
& & \eqn{\vdots}{} & \eqn{\vdots}{} & \eqn{\vdots}{} & \eqn{\ddots}{}\\
}
\end{Details}
\begin{Value}
Returns a list with the following elements 
\begin{ldescription}
\item[\code{call}] the call to \code{lambda.reg}
\item[\code{lambda}] an \eqn{R \times k}{} matrix 
where \eqn{k}{} is the
number of columns included in the share calculation
\item[\code{se}] standard errors calculated using the delta method as implemented 
in the library \code{msm}
\end{ldescription}
\end{Value}
\begin{Author}\relax
Ryan T. Moore \textless{}\email{rtm@wustl.edu}\textgreater{}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{ei.reg}{ei.reg}}
\end{SeeAlso}

