Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[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: http://cl.ly/34Px
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
Regards,
Leon
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/