- 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 30 times
treatment =gl(2,50, labels =c( "Treatment", "Control" ))) If you want to print out "mean" of m.example\$age by m.example
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
treatment =gl(2,50, labels =c( "Treatment", "Control" ))) If you want to print out "mean" of m.example\$age by m.example
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)