\Header{model.extract}{Extract components from a model frame}
\alias{model.offset}{model.extract}
\alias{model.response}{model.extract}
\keyword{manip}{model.extract}
\keyword{programming}{model.extract}
\keyword{models}{model.extract}
\begin{Usage}
\begin{verbatim}
model.extract(frame, component)
model.offset(frame)
model.response(frame)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{frame}] A model frame
\item[\texttt{component}] The name of a components to extract, such as
\texttt{"weights"}, \texttt{"subset"}
\end{ldescription}
\end{Arguments}
\begin{Description}
Returns the response, offset, subset, weights or other
special components of a model frame passed as optional arguments to
\texttt{\Link{model.frame}}. \texttt{model.offset} and
\texttt{model.response} are equivalent to \texttt{model.frame(,"offset")}
and \texttt{model.frame(,"response")} respectively.\end{Description}
\begin{Value}
The specified component of the model frame, usually a vector.\end{Value}
\begin{SeeAlso}
\texttt{\Link{model.frame}}, \texttt{\Link{offset}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(esoph)
a <- model.frame(cbind(ncases,ncontrols) ~ agegp+tobgp+alcgp,data=esoph)
model.extract(a,"response")
all(model.extract(a,"response") == model.response(a))

a <- model.frame(ncases/(ncases+ncontrols) ~ agegp+tobgp+alcgp,
                 data = esoph, weights = ncases+ncontrols)
model.response(a)
model.extract(a,"weights")

a <- model.frame(cbind(ncases,ncontrols) ~ agegp,
                 something = tobgp, data = esoph)
names(a)
all(model.extract(a,"something")==esoph$tobgp) # TRUE
\end{ExampleCode}
\end{Examples}

