0

My hope is to create a large summary table that contains all of the VARIABLES in my dataset and shows the OVERALL mean and standard deviation for the full sample and also by different GRADES (like the picture). It is also important that factor type variables like TEACHER in the example show the different levels.

enter image description here

I have made an attempt to do this in DPLYR but it does not seem to work in my favor

  select(data) %>%
  group_by(GRADE) %>%
  summarise(mean(),std())

And here is some sample data so I would want to mean and st.dev.

have <- data.frame("CLASS_SIZE"=c(25,26,24,22,35,36),
                   "FEMALE"=c(.53,.55,.67,.67,.55,.47),
                   "TEACHERS"=c(1,1,1,2,3,3),
                   "GRADE"=c('A','A','B','B','C','C'))
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
bvowe
  • 3,004
  • 3
  • 16
  • 33
  • 4
    Please share sample of your data using `dput()` (not `str` or `head` or picture/screenshot) so others can help. See more here https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example?rq=1 – Tung Oct 02 '18 at 17:43
  • @Tung updated-cheers – bvowe Oct 02 '18 at 17:55
  • great. please add the expect output you want as well – Tung Oct 02 '18 at 18:57
  • Can you explain what your example shows? How do you get 7 for GRADE A and TEACHERS 2, especially if TEACHERS is a factor? Where are you using std and mean? – Nicolas2 Oct 03 '18 at 11:03

0 Answers0