I have a dataset that looks like this:
study_id weight gender
1 100 55 Male
2 200 65 Female
3 300 84 Female
4 400 59 Male
5 500 62 Female
6 600 75 Male
7 700 70 Male
I would like to find the mean, median, etc. (everything that the summary() function gives) for the weight variable, but separately for both men and women.
In other words, I would like to find the summary statistics of the weight variable for males and females separately.
How can I go about doing this?
Reproducible Data:
data<-data.frame(study_id=c("100","200","300","400","500","600","700"),weight=c("55","65","84","59","62","75","70"),gender=c("Male","Female","Female","Male","Female","Male","Male"))