Page 1 of 1

Descriptive stats for subgroups

Posted: Thu Sep 27, 2012 11:59 pm
by acjennings
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

Re: Descriptive stats for subgroups

Posted: Fri Sep 28, 2012 7:05 am
by EViews Gareth
Open up the series, then click on View->Descriptive Statistics->Stats by classification.

Re: Descriptive stats for subgroups

Posted: Fri Sep 28, 2012 10:06 am
by EViews Glenn
If you want to create series with these you should look at the family of by-group statistics functions, as in @meansby and @obsby.

Re: Descriptive stats for subgroups

Posted: Tue Oct 02, 2012 4:23 pm
by acjennings
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

Re: Descriptive stats for subgroups

Posted: Wed Oct 03, 2012 9:59 am
by EViews Glenn

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.