Re: [R] t-test across columns

2013-07-15 Thread arun
Nico Met' ; 'R help' Cc: Sent: Monday, July 15, 2013 1:33 PM Subject: Re: [R] t-test across columns This may be close to what you want: > t.val <- by(x, x$cat, function(y) if (min(table(y$name)>1)) { +      t.test(val~name, y)}) > t.out <- do.call(rbind, sapply(t.val, f

Re: [R] t-test across columns

2013-07-15 Thread David Carlson
-- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nico Met Sent: Monday, July 15, 2013 10:50 AM To: R help Subje

Re: [R] t-test across columns

2013-07-15 Thread arun
l p238921966_p.val 12.2   -0.3320635    0.7435689 3.365969  0.007199016 15.9   NA   NA   NA   NA A.K. - Original Message - From: Nico Met To: R help Cc: Sent: Monday, July 15, 2013 11:50 AM Subject: [R] t-test across co

[R] t-test across columns

2013-07-15 Thread Nico Met
Dear all, I would like to do t-test across two columns "name" with different "cat" with overall mean ("val"). (Removing if there is a single observation) And finally, make a matrix with t-value and p-value associated with a name (in rows) and cat (in columns) dput(x) structure(list(name = struc