[R] how to check if a variable is preferentially present in a sample

2008-04-08 Thread Tania Oh
Dear All, I do apologise if this question is out of place for this list but I've tried searching mailing lists and read Introductory Statistics with R by Peter Dalgaard, but couldn't find any hints on solving my question below: I have a data frame (d) of values which I will rank in

Re: [R] how to check if a variable is preferentially present in a sample

2008-04-08 Thread Jorge Velez
Hi Tania, I think it could be. I tried a solution based on your data set using a chi-squared approach. Here is what I got: # # Data set set.seed(123) d - data.frame(cbind(val=rnorm(1:10)^2, group=sample(LETTERS[1:5],100,repl=TRUE))) d[,val]-as.numeric(as.character(d$val)) #