![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using 'sed' to delete or ignore columns in a dataset | aarif | UNIX for Dummies Questions & Answers | 4 | 07-21-2008 01:22 PM |
| Finding number of records in SAS dataset | sasaliasim | High Level Programming | 1 | 04-24-2008 09:19 AM |
| Numbers of records in SAS dataset | sasaliasim | Shell Programming and Scripting | 2 | 04-21-2008 05:55 PM |
| Using 'sed' to delete or ignore columns in a dataset | aarif | UNIX for Dummies Questions & Answers | 0 | 02-29-2008 01:21 PM |
| Accessing Mainframe Dataset | IcyGuava | UNIX for Dummies Questions & Answers | 4 | 10-18-2001 09:12 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Normalize a dataset with AWK
Hello everyone, i have to normalize this dataset (with 20.000 rows): 2,4,4,3,2,7,8,2,9,11,7,7,1,8,5,6 4,7,5,5,5,5,9,6,4,8,7,9,2,9,7,10 7,10,8,7,4,8,8,5,10,11,2,8,2,5,5,10 4,9,5,7,4,7,7,13,1,7,6,8,3,8,0,8,8 6,7,8,5,4,7,6,3,7,10,7,9,3,8,3,7,8 in this form: value=($1*mean)/standard_deviation but i cant figure out how to normalize it. I write this file to calculate the standard distribution and mean. Code:
BEGIN{
FS=","
}
{
for(i=1;i<NF;i++)
{
total[i]+=$i;
totalSquared[i]+=$i^2;
}
numberColumn=NF;
}
END{
for (i=1;i<numberColumn;i++)
{
media=total[i]/NR;
printf("%.2f|%.2f\n",media,sqrt((totalSquared[i]/NR)-media^2));
}
}
Can anyone help me to figure out? |
| Bookmarks |
| Tags |
| awk, statistical calculator, statistics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|