Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu Show menu

<DATA> data block

Scripts example - <DATA> data block

cls;
// regional settings
$decimalsymbol=".";
$listseparator=",";
// clear spreadsheet data
clear data;
// define data
<data>
"Weight"  "Height"
60        1.65
80        1.70
          1.8
64            
</data>
// convert columns to a matrix 
d={weight,height};
// display matrix
print("data matrix:"); println;
print d;
// display column averages
print ("column means:"); println;
print average(d);

Output

data matrix:
│ 60  1.65 │
│ 80   1.7 │
│      1.8 │
│ 64       │
column means:
│ 68  1.716666667 │

See also