I'm pretty new to the R programming, but I am ever learning :)
I want to conduct a paired Wilcoxon Rank Sum test of before and after measurements. My subjects have gotten 4 different types of treatments (i.e. treatment as factor w/ 4 levels). My data is ordinal.
I have a data frame containing 3 columns:
- Before
- After
- Type of treatment
Can I run the wilcox.test while subsetting the different types of treatments?
I ran the wilcox.test as follows:
wilcox.test(Before,After,paired=TRUE)
how do I edit this code to subset for my types of treatment?
Hope there is someone able to help me... :)
Before | After | Treatment
------ | ------ | ---------
2 | 2 | SH
2 | 1 | SH
2 | 2 | SH
1 | 1 | SH
2 | 2 | OH
2 | 2 | OH
2 | 2 | OH
2 | 1 | OH
2 | 1 | SA
2 | 1 | SA
1 | 1 | SA
2 | 2 | SA
2 | 2 | OA
2 | 3 | OA
1 | 2 | OA
2 | 2 | OA