@meansby |

Mean of observations in a series for each specified group defined by distinct values.

Syntax: @meansby(x, y[y1, y2, ... yn, s])

x: series

y1...yn series, alpha, group

s: (optional) sample string or object

Return: series

Compute the mean of observations in x for group identifiers defined by distinct values of y, using the current or specified workfile sample.

Examples

show @meansby(x, g1, g2)

produces a linked series of by-group means of the series x, where members of the same group have identical values for both g1 and g2.

Cross-references

See also
@demeanby.