How to write a loop to run the t-test of a data frame?
问题 I met a problem of running a t-test for some data stored in a data frame. I know how to do it one by one but not efficient at all. May I ask how to write a loop to do it? For example, I have got the data in the testData: testData <- dput(testData) structure(list(Label = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L ), .Label = c("Bad", "Good"), class = "factor"), F1 = c(0.647789237, 0.546087915, 0.461342005, 0.794212207, 0.569199511, 0