\HeaderA{contr.sdif}{Successive Differences contrast coding}{contr.sdif}
\keyword{models}{contr.sdif}
\begin{Description}\relax
A coding for unordered factors based on successive differences.
\end{Description}
\begin{Usage}
\begin{verbatim}
contr.sdif(n, contrasts = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{n}] The number of levels required.

\item[\code{contrasts}] Should there be \code{n - 1} columns orthogonal to the mean (the default)
or \code{n} columns spanning the space.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The contrast coefficients are chosen so that the coded coefficients
in a one-way layout are the differences between the means of the
second and first levels, the third and second levels, and so on.
\end{Details}
\begin{Value}
If \code{contrasts is} \code{TRUE}, a matrix with \code{n} rows and \code{n - 1} columns,
and the \code{n} by \code{n} identity matrix if \code{contrasts} is \code{FALSE}.
\end{Value}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.}
Fourth Edition, Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{contr.treatment}{contr.treatment}}, \code{\LinkA{contr.sum}{contr.sum}}, \code{\LinkA{contr.helmert}{contr.helmert}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
contr.sdif(6)
\end{ExampleCode}
\end{Examples}

