I often want a bivariate version of the tabstat command. Let me explain what I mean.
The tabulate command can cross-tabulate two variables: for example "tab x y".
The tabstat command can give the mean (or other statistic) of one variable for each value of another: for example "tabstat z, by(x)".
What I'd like is a command that can do both of these things at once, giving the mean (or other statistic) of one variable for each combination of two others. If tabstat could do this, the syntax might be "tabstat z, by(x y)".
Is there a command that can do what I'm suggesting?
The tabulate command can cross-tabulate two variables: for example "tab x y".
The tabstat command can give the mean (or other statistic) of one variable for each value of another: for example "tabstat z, by(x)".
What I'd like is a command that can do both of these things at once, giving the mean (or other statistic) of one variable for each combination of two others. If tabstat could do this, the syntax might be "tabstat z, by(x y)".
Is there a command that can do what I'm suggesting?
Comment