[R] apply, t-test and p-values

John Sorkin jsorkin at grecc.umaryland.edu
Thu Oct 16 14:01:48 CEST 2008


R 2.7.2
Windows XP

I am using apply to compute a series of Student's t-test from two matrices, sample1 and sample2.
boo<-apply(sample1,1,t.test,sample2)

 I want to pick of the p-values from the tests, but can't seem to get it to work. I have tried several methods to get the values including:
boo<-apply(sample1,1,t.test$t.test,sample2)
boo<-apply(sample1,1,t.test,sample2)$t.test

any suggestions?

Thanks
John

John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC,
University of Maryland School of Medicine Claude D. Pepper OAIC,
University of Maryland Clinical Nutrition Research Unit, and
Baltimore VA Center Stroke of Excellence

University of Maryland School of Medicine
Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524

(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)
jsorkin at grecc.umaryland.edu
Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}



More information about the R-help mailing list