Data parameters can now support grouped data.
$g=data(10~20:2,20~30:6,30~40:4,40~50:2)
This data parameter is equivalent to this frequency table.
| Data | Frequency |
| 10 < x <= 20 | 2 |
| 20 < x <= 30 | 6 |
| 30 < x <= 40 | 4 |
| 40 < x <= 50 | 2 |
Each entry in the data parameter is the group definition, separated by a ~, and the frequency, separated by a :.
Statistical Calculator Commands
All statistical commands honour the group and frequency information. For example {mean($g)} will return 29.28
Grouped Data Calculator Commands
The definition of $g creates 4 group entries. If you reference one of the entries, $g[3] for example, you will see 30~40:4. There are two commands which allow you to access the group definition and the frequency of the entry.
{groupdefn($g[3])} will return 30~40
{freq($g[3])} will return 4
Grouping Existing Data
If you have a parameter which contains raw, ungrouped data you can group it using a calculator command.
For example. If
$p=randnormal(50,15,30)
{group($p)} will return the raw data automatically grouped.
Often, the best way to use the group command is within parameter definitions.
$p=randnormal(50,15,30)
$g=group($p)
This will create a set of randomly generated grouped data, perfect for histogram type questions.
Discover more from Efofex News
Subscribe to get the latest posts sent to your email.