Hello Statalist,
Let me introduce myself - I'm a beginner in the Stata world and would kindly ask for some assistance regarding a question I have.
I'd like to collapse the variable ilos_sum by 4 other variables (periodid code16n ndf patienthash).
To that end my steps are as follows:
collapse (sum) ilos_sum by(periodid code16n ndf patienthash)
To which I get factor variables not allowed r (101)
I've attempted several other approaches, including:
egen long aggregated=group(periodid code16n ndf patienthash) //grouping
collapse (sum) ilos_sum by(aggregated) //final aggregation
Unfortunately I could not find the necessary information to the best of my abilities in the forum or other sources. Everywhere we had aggregation by one variable only.
Thank you!
Let me introduce myself - I'm a beginner in the Stata world and would kindly ask for some assistance regarding a question I have.
I'd like to collapse the variable ilos_sum by 4 other variables (periodid code16n ndf patienthash).
To that end my steps are as follows:
collapse (sum) ilos_sum by(periodid code16n ndf patienthash)
To which I get factor variables not allowed r (101)
I've attempted several other approaches, including:
egen long aggregated=group(periodid code16n ndf patienthash) //grouping
collapse (sum) ilos_sum by(aggregated) //final aggregation
Unfortunately I could not find the necessary information to the best of my abilities in the forum or other sources. Everywhere we had aggregation by one variable only.
Thank you!
Comment