Page 1 of 1

SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS

Posted: Thu Nov 14, 2013 3:49 pm
by VALIA
Can you help me to calculate the sum of values and stdev by the cross-section in a panel data setting, please?
The ID is the cross-section ID, the rest are the variables. Thank you.

Re: SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS

Posted: Fri Nov 15, 2013 10:13 am
by EViews Esther
One simple (and effortless) way to calculate cross-sectional-wise sums and stdev is the following.

Code: Select all

for !i=1 to @max(id01) smpl if id01 = !i scalar sum_!i = @sum(w_ret_2) scalar std = @stdev(w_ret_2) next
Do you know that your workfile can be structured in panel? Please type

Code: Select all

pagestruct id01
in your command window.

Re: SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS

Posted: Fri Nov 15, 2013 12:49 pm
by EViews Glenn
There is a statby view that does this as well as more general by-group summary stats.

From a series, View/Descriptive Statistics & Tests/Stats by Classification...

Re: SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS

Posted: Fri Nov 15, 2013 1:15 pm
by VALIA
Thanks a mill! :D