I need to calculate equially- and value-weighted variance and skewness for each id/month.
I am aware of rangestat equally-weighted code:
Code:
rangestat (sd) market_returns (skewness) market_returns, interval ( monthly_date . 0) by(id) gen variance_market_returns=market_returns_sd^2
If not, what is the alternative way out?
I am aware of collapse command which can adjust for weights but it does not have variance or skewness option.
Code:
collapse (sd) market_returns [weight=market_cap], by (id month)
Thank you.
0 Response to Rangestat: value weighted variance and skewness
Post a Comment