#######################################################
# 9 Adding Models and Methods to Zelig 77
# 9.3 Formatting Reference Manual Pages....................... 84
#######################################################
9.3 参考手册页的格式
Zelig最主要优点之一就是对模型有完整的文献,与由函数而组织的R文献中面向对象的程序设计的差别。因此,我们要求Zelig的撰稿人提供相似的文献,包括传递给zelig()的句法和参量,还有模型的系统组分和随机组分、“感兴趣的统计量”、输出的值和更多信息(包括参考)。有几个方式提供这些文献:
-如果你已有一个用.Rd帮助格式的PKG文献,help.zelig()将自动搜索除了Zelig帮助文件外的R帮助文件。
-如果你已有一个静态的URLs在线HTML格式的PKG文献(象Zelig或MatchIt),你需要提供一个PACKAGE.url.tab文件,它是一个两列表,第一列是函数名,而url在第二列。(纵使该文件的扩展是.url.tab,,该文件应该是一个tab-or space-delimited文本文件。)例如:
command
http://gking.harvard.edu/zelig/docs/Main_Commands.html
model
http://gking.harvard.edu/zelig/docs/Specific_Models.html
如果你想检测来查看是否你的 .url.tab能运行,简单地把它放到你的R library/Zelig/data/ directory中。(你不需要重新安装Zelig来检测你文件的.url.tab。)
-首选方法:你可以提供LATEX 2ε.tex文件。这种文献使用的书籍格式和从下列包中支持命令:graphicx, natbib, amsmath, amssymb, verbatim, epsf 和 html。因为使用\include{}模型页被组合成一体进入这种文献中,在呈送之前,你将确信你的文献编辑。请粘连到下列约定到你的模型页:
1. 全部数学公式将能用equation*、array和eqnarray*,或校准环境来排版。请避免显示方式。(以html看起来有点滑稽)
2. 全部命令或R对象将使用texttt环境。
3. 模型以较大文献的亚组开始,在模型页内的各部分是亚-亚组水平。
4. 对于格式的一致性,请避免使用描述性环境。
每个LATEX模型页将包括下列元素。让投稿人指定新模型。
临时帮助文件
\subsection{{\tt contrib}: Full Name for [type] Dependent Variables}
\label{contrib}
\subsubsection{Syntax}
\subsubsection{Examples}
\begin{enumerate}
\item First Example
\item Second Example
\end{enumerate}
\subsubsection{Model}
\begin{itemize}
\item The observation mechanism, if applicable.
\item The stochastic component.
\item The systematic component.
\end{itemize}
\subsubsection{Quantities of Interest}
\begin{itemize}
\item The expected value of your distribution, including the formula
for the expected value as a function of the systemic component and ancillary paramters.
\item The predicted value drawn from the distribution defined by the corresponding expected value.
\item The first difference in expected values, given when x1 is specified.
\item Other quantities of interest.
\end{itemize}
\subsubsection{Output Values}
\begin{itemize}
\item From the {\tt zelig()} output stored in {\tt z.out}, you may
extract:
\begin{itemize}
\item
\item
\end{itemize}
\item From {\tt summary(z.out)}, you may extract:
\begin{itemize}
\item
\item
\end{itemize}
\item From the {\tt sim()} output stored in {\tt s.out}:
\begin{itemize}
\item
\item
\end{itemize}
\end{itemize}
\subsubsection{Further Information}
\subsubsection{Contributors}
<入门部分介绍完毕,后面各章节是参考手册>