SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

VALIA
Posts: 7
Joined: Mon Jul 18, 2011 12:55 pm

SUM AND STDEV OF CROSS-SECTIONS IN PANEL SETTINGS

Postby VALIA » Thu Nov 14, 2013 3:49 pm

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.
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

Postby EViews Esther » Fri Nov 15, 2013 10:13 am

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.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

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

Postby EViews Glenn » Fri Nov 15, 2013 12:49 pm

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...

VALIA
Posts: 7
Joined: Mon Jul 18, 2011 12:55 pm

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

Postby VALIA » Fri Nov 15, 2013 1:15 pm

Thanks a mill! :D


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests