Displaying 1 result from an estimated 1 matches for "comnn".
Did you mean:
combn
2011 Dec 04
3
Group several variables and apply a function to the group
..., x=x)
For each company, within a particular month, I would like to compute the
standard deviation of x: for example, for abc, I would like to compute the
sd of x for month1 (when mi=1) and for month2 (when mi=2).
In other languages (Stata for instance), I would create a grouping variable
(group comnn and mi) and then, apply the sd function for each group.
However, I don't find an elegant way to do the same in R:
I was thinking about the following: I could subset my data frame by mi and
create one file per month, and then make a loop and in each file, use a
"by" operator for each...