\section{Cramer-von Mises Test}
The Cramer-von Mises (CVM) test is also based on the CDF of the hypothesized distribution.  In the case of the CVM test we use the statistic
\begin{equation}
CM = \frac{1}{12n} + \sum_{i=1}^{n}\left( F(x_{i:n}) - \frac{i - 0.5}{n} \right)^{2} \label{cvm}
\end{equation}
The $CM$ statistic takes into account all of the ordered data points and uses a half point correction.  It can also be said that under $H_{0}$, the distribution of $F$ is uniform on $(0,1)$.  This fact could be exploited to make calculations easier.The critical values for $CM$ have been calculated by Pettitt and Stephans (1976)\footnote{``Modified Cramer-von Mises Statistics for Censored Data'' \texttt{Biometrika}. \textbf{63}, p. 291}.

\subsection{Calculations}
\texttt{R} provides a function called \texttt{cvm.test} in the \texttt{nortest} package.  This function performs the CVM test and tests for normality.  It takes a dataset as its argument and returns a p-value.  We will reject for p-values $ < \alpha=0.05$.

Again, our first simulations involve using the definition found in (\ref{skewdata}) to skew the data in order to simulate the power function.  As in Figure (\ref{dpowerks}) we will plot the observed rejection rate as a function of $\delta$.
\begin{figure}[ht]
\begin{center}
\includegraphics[scale=0.55]{cvmdelta.eps}
\caption{Power as a function of $\delta$ (CVM test)}
\label{dpowercvm}
\end{center}
\end{figure}

Figure (\ref{dpowercvm}) shows that the CVM test does not recognize that the data has been contaminated very well.  When we have $\delta = 5$ the observed rejection rate is only at $0.5$, this does not compare well to the KS test.
\begin{figure}[ht]
\begin{center}
\includegraphics[scale=0.55]{npowercvm.eps}
\caption{Power as a function of sample size (CVM test)}
\label{npowercvm}
\end{center}
\end{figure}

When we look at the power analysis based on sample size, Figure (\ref{npowercvm}), we see that in order to get good results we need a sample size of 150 or more.  This also indicates that the CVM test does not perform as well as the KS test.
