Dear Statalist,
Excuse me for this rather rudimentary question but it has puzzled me for a few days.
I have a panel data containing daily observation for ten years (hence 3650+ observations), and I would like to find the sum and mean of certain variables by month and year so that the panel collapses to a monthly panel with 120 observations. My date variable is in the form of 2007.12.31 and is already in date format.
For summation, I was trying to use the below command but was not sure how should I specify the
option.
Please let me know if I missed anything and thank you very much in advance!
Yangxi
Excuse me for this rather rudimentary question but it has puzzled me for a few days.
I have a panel data containing daily observation for ten years (hence 3650+ observations), and I would like to find the sum and mean of certain variables by month and year so that the panel collapses to a monthly panel with 120 observations. My date variable is in the form of 2007.12.31 and is already in date format.
For summation, I was trying to use the below command but was not sure how should I specify the
Code:
by
Code:
preserve collapse (sum) varlist1, by()
Yangxi
Comment