Good afternoon,
I am trying to compute weighted average and weighted standard deviation:
The weighted average seems fine, but the weighted standard deviation is missing in most cases (even though the weights exist, and there is a minimum of 2 observations per year-month-day). Could someone please help identify the problem?
Thank you,
Stan
I am trying to compute weighted average and weighted standard deviation:
Code:
. collapse (mean) portret (sd) weighted_sd =portret [iweight= weight16 ], by(year month day) . count 5,649 . count if portret==. 0 . count if weighted_sd ==. 3,590
Thank you,
Stan
Comment