Dear Statalist,

For my Masters I need to replicate a paper using Stata. I have managed to successfully merge all my data to a similar dataset as used in the paper which I need to replicate. This dataset contains monthly panel data containing 2,300 firms and 84 months resulting in almost 150k observations. But at the moment I'm struggling to replicate the descriptives tables which shows, next to common statistics as the mean SD and median, the SD within firms.
Via outreg2 I have created a descriptive table containing all other statistics except the SD within. I have tried to add these statics using the following methods without any useful result.

Code:
xtsum varlist
outreg2 using Meeting1.doco, replace sum(detail) keep(varlist) eqkeep(mean p50 sd p1 p99 N sd_w) see label
Code:
xtsum varlist
outreg2 using Meeting1.doco, replace sum(detail) keep(varlist) eqkeep(mean p50 sd p1 p99 N) addstat(SD within, e(r(sd_w)) see label
Code:
xtsum varlist
outreg2 using Meeting1.doco, replace sum(detail) keep(varlist) eqkeep(mean p50 sd p1 p99 N) e(r(sd_w) see label
Could somebody please explain which commands I need to overcome this problem?

If something is not clear please explain to my what I need to change in my explanation.

Many thanks in advance!