Displaying 1 result from an estimated 1 matches for "my_swiss".
2012 Jan 21
1
Function for multiple t tests
...un t.test() for several variables among two groups, and I
would like to skip the tedious process of collecting information to
assemble a table, but I am not sure if the function I want already
exists. Any suggestion would be appreciated.
I have a working example, as required by the posting guide:
my_swiss = swiss[-1,]
my_swiss$facto = rep(1:2,nrow(my_swiss)/2)
t.test(Fertility~facto,data=my_swiss)
by(my_swiss$Fertility,my_swiss$facto, sd)
t.test(Agriculture~facto,data=my_swiss)
by(my_swiss$Agriculture,my_swiss$facto, sd)
ttable <- function(formula, data) { ???? }
ttable(Fertility + Agriculture...