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.
SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS
- Attachments
-
- SUM_STDEV_Q.xlsx
- (106.22 KiB) Downloaded 321 times
-
EViews Esther
- EViews Developer
- Posts: 149
- Joined: Fri Sep 03, 2010 7:57 am
Re: SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS
One simple (and effortless) way to calculate cross-sectional-wise sums and stdev is the following.
Do you know that your workfile can be structured in panel? Please typein your command window.
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)
nextCode: Select all
pagestruct id01
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS
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...
From a series, View/Descriptive Statistics & Tests/Stats by Classification...
Re: SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS
Thanks a mill! :D
Who is online
Users browsing this forum: No registered users and 2 guests
