0

I am interested in recreating the SAS NPAR1WAY results when creating an Empirical Distribution of Rank Test.

I found the following code for how to create the empirical distribution of rank graph using the iris dataset from Easier way to plot the cumulative frequency distribution in ggplot?

library(plyr)
data(iris)
#Ecdf within species
iris.species <- ddply(iris, .(Species), summarize,
Sepal.Length = unique(Sepal.Length),
ecdf = ecdf(Sepal.Length)(unique(Sepal.Length)))
ggplot(iris.species, aes(Sepal.Length, ecdf, color = Species)) + geom_step()

But I'm not sure how I would code the Kolmogorov-Smirnov Test, Cramer-von Mises Test, or Kuiper Test for Sepal.Length classified by Species.

Any help would be greatly appreciated!

jchamb
  • 1
  • 1
  • 1
    Could you clarify what the "SAS NPAR1WAY results" are? The Kolmogorov-Smirnov test is `ks.test()`, and Cramer Von Mises is `DescTools::CramerVonMisesTest()`. I'm not sure what you mean with applying distribution/normality tests "for Sepal.Length classified by Species". – Alexlok Dec 18 '20 at 03:41
  • @Alexlok I am trying to recreate SAS output in R which is referred to as SAS NPAR1WAY at the beginning of the output. The output produces an Empirical Distribution of Rank graph with lines for the three different species. Sepal.Length is the X axis and proportion is the Y axis. I believe the tests are used to assess the distributions. – jchamb Dec 18 '20 at 03:55

0 Answers0