automatically get mean and stdev of groups 05-16-2014d1449
2014-08-29automatically get mean and stdev of groups 05-16-2014d1449
Summary statistics by group
SummaryStatisticsByGroup
If there are rows in a table, and some of the rows are part of the same group as specified by a value in one of the columns, then I often like to make a new row for this group for the mean (and the standard deviation). This code will take in a table, and then find the average and the standard deviation based on grouping according to one of the attributes of each sample/object.
I wrote some Java code to do this
C:\Users\kurtw_000\Documents\kurt\storage\DR\2014\05-22-2014d1052\Summary statistics by group\Sandbox
SAS can do something like this
proc means data=GradeBySection min max median; ##the information you need
by Section; # the grouping variable
var Score; # the information of the variable you want
class Status Year; # the sub-grouping variable
jmp can get similar statistics for groups
- method 1
- -just make a table->analyze->distribution->put the group you want in the "by" section
- method 2
- -click the summary button (looks like a bunch of red and blue boxes with some lines)->choose which column to group by->choose the summary statistics you want (mean, median, etc.)->a table is output
R appears to have many ways of getting summary statistics by group
- describeBy function
- -https://personality-project.org/r/html/describe.by.html
- other options: http://stackoverflow.com/questions/9847054/how-to-get-summary-statistics-by-group
- aggregate function in r
- -http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/epicalc/html/aggregate.numeric.html