Hi,

I have a dataframe with multiple (appr. 20) columns containing
vectors of different values (different distributions).
 Now I'd like to create a crosstable
where I compare the distribution of each vector (df-column) with
each other. For the comparison I want to use the ks.test().
The result should contain as row and column names the column names
of the input dataframe and the cells should be populated with
the p-value of the ks.test for each pairwise analysis.

My data.frame looks like:
df <- data.frame(X=rnorm(1000,2),Y=rnorm(1000,1),Z=rnorm(1000,2))

And the test for one single case is:
ks <- ks.test(df$X,df$Z)

where the p value is:
ks[2]

How can I create an automatized way of this pairwise analysis?
Any suggestions? I guess that is a quite common analysis (probably with
other tests).

cheers,
Johannes

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to