Output Basic Statistics in Excel via - tabout -

#1
Hi,

I am trying to output in Excel the mean and median of a few variables that we will call var1, var2, var3 etc.. by SECURITY and EVENT_WINDOW, two other variables in my dataset. The tables would something like that:

EVENT_WINDOW(1)
mean(var1) median(var1) mean(var2) mean(var2) ...
SECURITY(1)
SECURITY(2)
SECURITY(3)
etc
SECURITY(N)

EVENT_WINDOW(2)
mean(var1) median(var1) mean(var2) mean(var2) ...
SECURITY(1)
SECURITY(2)
SECURITY(3)
etc
SECURITY(N)
......
EVENT_WINDOW(N)
mean(var1) median(var1) mean(var2) mean(var2) ...
SECURITY(1)
SECURITY(2)
SECURITY(3)
etc
SECURITY(N)

I have tried something like that but it does not work:

tabout security event_window using test.txt, ///
cells(mean var1 median var1 mean var2 median var2) ///
replace

Somebody can help please :(?