Page 1 of 1

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
by answerhappygod
Treatment Gl 2 50 Labels C Treatment Control If You Want To Print Out Mean Of M Example Age By M Example 1
Treatment Gl 2 50 Labels C Treatment Control If You Want To Print Out Mean Of M Example Age By M Example 1 (47.67 KiB) Viewed 31 times
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)