#!/usr/local/bin/awk -f
BEGIN{
print "sum", "ave", "var", "std"
sum=0;
count=0;
var=0;
}
{
if(($1 !~ "#")&&($1 !~ "@")){
sum+=$2
var+=$2*$2
count++
};
END{
ave=sum/count;
var/=count;
var-=ave*ave;
std=sqrt(var);
print sum, ave, var, std;
Permalink | 記事への反応(0) | 19:41
ツイートシェア