Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Variable Estimation

From   Léon Bueckins <[email protected]>
To   [email protected]
Subject   st: Variable Estimation
Date   Sun, 7 Nov 2010 18:05:47 +0100

Hello statalisters,

I try to estimate the following variable, basing upon this equation:
But somehow I can't get it to work properly, so I may need some help. The problem is that N is different for each t.

*get number of groups per t
bysort igroup : g trun =_n 
local nGroups =r(n) 

*get mean return per t = r_m,t
g r_m = (sum(return))/_n

*get csad
g csad = (abs(return - r_m))/`nGroups'

May somebody got an idea, thank you so much for helping me


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index