Hi, I have the following collapse function:
collapse (mean) mean_BARTAdj=BARTAdj (sd) sd_BARTAdj=BARTAdj (count) n=BARTAdj, by(weekday)
which works just fine. Now, I would like to add a condition. I have another variable sense. If sense >=3 I would like to create a mean, sd and n and if sense <3, I would like to create mean, sd and n.
Thank you very much!
collapse (mean) mean_BARTAdj=BARTAdj (sd) sd_BARTAdj=BARTAdj (count) n=BARTAdj, by(weekday)
which works just fine. Now, I would like to add a condition. I have another variable sense. If sense >=3 I would like to create a mean, sd and n and if sense <3, I would like to create mean, sd and n.
Thank you very much!
Comment