Descriptive stats for subgroups

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

acjennings
Posts: 2
Joined: Thu Sep 27, 2012 11:29 pm

Descriptive stats for subgroups

Postby acjennings » Thu Sep 27, 2012 11:59 pm

Hi, I have a spreadsheet in excel and my data looks like as follows :

Gender...Education...Country...Status...Index...Income
F.........College......USA........Single....Yes.....10
F........College......USA........Single....Yes......11
F.......Master.......USA........Single....No.......12

I would like to create a series for "average Income" and another series for the "number of observations" for each subgroup.

Result:
Gender...Education...Country...Status...Index...Average Income.....# of obs
F........College.......USA.......Single....Yes.............8..................1500

My data set contains over 500,000 rows with 200 subgroups with min 1,000 observations for each subgroup.
Thank you very much

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Descriptive stats for subgroups

Postby EViews Gareth » Fri Sep 28, 2012 7:05 am

Open up the series, then click on View->Descriptive Statistics->Stats by classification.

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

Re: Descriptive stats for subgroups

Postby EViews Glenn » Fri Sep 28, 2012 10:06 am

If you want to create series with these you should look at the family of by-group statistics functions, as in @meansby and @obsby.

acjennings
Posts: 2
Joined: Thu Sep 27, 2012 11:29 pm

Re: Descriptive stats for subgroups

Postby acjennings » Tue Oct 02, 2012 4:23 pm

Thank you very much,

I am quite new to EViews. Can you give me an example with @meansby and @obsby? Say, "Gender...Education...Country...Status...Index...Income" are my variables.

Thanks again

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

Re: Descriptive stats for subgroups

Postby EViews Glenn » Wed Oct 03, 2012 9:59 am

Code: Select all

series avgincome=@meansby(income, gender, education, country, status, index)
will compute the average INCOME in each subgroup defined by the cross of the series GENDER, EDUCATION, COUNTRY, STATUS, and INDEX, and match merge those results back into the original observations in the new series AVGINCOME.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests