[R] wilcox.test; data type conversion?

Par Leijonhufvud par at hunter-gatherer.org
Fri Oct 29 07:03:46 CEST 2010


Steven McKinney <smckinney at bccrc.ca> [2010.10.29] wrote:
> You can set up the data as
> 
> > grade <- ordered(c("MVG", "VG", "VG", "G", "MVG", "G", "VG", "G", "VG"), levels = c("G", "VG", "MVG"))

> wilcox.test(as.integer(grade) ~ sex, data = gradesbysex)

Thanks, this solved my problems. I'll just explain the problem with
ties, that is easier to understand than running jitter and comparing.

> As for the barplots, I think all you need to do is specify the row and column order you'd like.
> 
> Try this example
> 
> > barplot(VADeaths, beside = TRUE)
> > barplot(VADeaths[5:1,c(4, 2, 3, 1)], beside = TRUE)
> 
> Substitute your data, use beside=FALSE to stack, etc.

Ahh, that simple. I'll fiddle on with that. 

Trying to wean the students away from using Excel for all numbers related
work...



More information about the R-help mailing list