What i'm trying to do is sum a table variable if another one is true, example:
This is a part of my table:
  School  sex  age  studytime
1 2       m    18   2,1
1 1       m    19   2,8
1 2       f    18   2,6
1 3       m    17   2,7
1 3       f    17   1,1
1 4       f    19   3,8
1 1       m    20   2,5
And i need to sum studytime for each sex, something like this:
sex  studytime
m    10,1
f    7,5
 
     
    