treatment =gl(2,50, labels =c( "Treatment", "Control" ))) If you want to print out "mean" of m.example\$age by m.example
Posted: Tue Jul 12, 2022 8:17 am
treatment =gl(2,50, labels =c( "Treatment", "Control" ))) If you want to print out "mean" of m.example\$age by m.example\$treatment, which function in the following would be the correct one for it? HINT: run ?sapply and ? tapply to check syntax of these functions. The outcome results will look like this: Treatment Control 64.2811660.01872 sapply(m.example\$age, m.example\$treatment, mean) tapply(m.example\$age, m.example\$treatment, mean) sapply(m.example\$age, mean) tapply(m.example\$age, mean)