# Trying to run statistical tests in R but struggling as I am new to the language

Good Day, I believe this issue is more of a lack of understand of R (as I have never used it till recently) than anything else. What I am looking for is references, or documents to help me solve my problem.

I have a set of data that I created a pair of decision tress on (pruned and unpruned). I did this using Weka and 10-fold cross-validation. There was no problem here. I got a higher accuracy for the pruned tree and I have individual accuracies for each of the ten folds.

I am now working on doing statistical testing to these two trees, I want to do a T-Test and the Wilcoxon test. It was suggested that I use the

experimentalComparison()


function for the cross-validation, but I can already do this in weka. For the actual stat tests I can do the t-test similar to the example here by manually feeding the values from the individual fold-tests similar to what is in the code in that example. The Wilcoxon test is what is throwing me off. I found this example but I was told to use the function

compAnalysis()


in the DMwR package. I looked at the documentation for it and I do not quite understand it. It says to feed in the results from experiemntalComparison() for the first value, which means I should be doing my cross-validation with that function (vs. weka). I am not understanding how to get the "trees" I made in weka this function. The documentation refers to some usermade class cv.rpartXse. So I am stumped, being new to this language, on how to accomplish these statistical tests via R.

-

Recommend the following from the http://cran.r-project.org/ site. Select manuals from the left menu bar and open An Introduction to R. While this may cover more than you want, it is kept current with the latest released R core package.

Now select contrib from the left menu bar. Here I suggest you look at several of the offered documents until you find one whose presentation is the clearest for you.

As a side note. If you have two data vectors x and y then then t.test(x,y) will do the two sample t test. Input ?t.test for information about the options.

And wilcox.test(x,y) will do a two sample wilcoxen test. Again use ?wilcox.test for details about the options.

-
Thanks a lot. I saw these earlier and they look quite simple, much easier than the suggested compAnalysis() and experimentalComparison() functions I was suggested to use. Do you know why those might have been of any use? –  Josh Weissbock Sep 26 '12 at 16:50
Without data context information, I am assuming that you were being directed to bootstrap/jackknife/resampling or simulation to provide parameter estimates. –  R. Schumacher Sep 26 '12 at 19:34
Thanks, our data that we were provided was in a big .arff file. That's more weka where I am analyzing it and feeding the answers manually into R. –  Josh Weissbock Sep 27 '12 at 2:26