By-group statistics

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

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

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

By-group statistics

Postby jthodge » Wed Jan 07, 2009 10:29 am

Hello,

I have some questions about using the By-Group statistics functions, specifically @meansby(arg1,arg2[,s]). I understand the first argument is the series you want to average. But what is arg2?

From the documentation, I assume you have to create a group for arg2, where the series in the group defines the unique by-groups of observations you're trying to average over (the group excludes the arg1 series, right?).

Yet, when I try this, the function only averages over observations who share a common value in the first series of the group, not over observations who share common values for all three of the series in my group. Note that I'm using an alpha series and two numerical series to define my by-groups.

In Eviews code, here's what I'm trying to do:

group bygrp series1 alpha2 series3
genr testvar = @meansby(series0,bygrp)

I've sorted the workfile in ascending order by the series1, alpha2, and series3 in my group. Also, I'm not using any specific sample for [,s].

What am I doing wrong?

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

Re: By-group statistics

Postby EViews Gareth » Wed Jan 07, 2009 10:38 am

The by statistics will only classify by a single series. Thus arg2 should be entered as a series name. If you enter a group name, EViews will simply use the first series in that group.
Follow us on Twitter @IHSEViews

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Re: By-group statistics

Postby jthodge » Wed Jan 07, 2009 10:52 am

Thanks Gareth,

I see in the documentation now that "arg2 is a numeric or alpha series expression identifying the subgroups." I guess I overlooked that statement and assumed that you needed to use group objects for by-group statistics.

It would be nice in future versions of Eviews to have the ability to calculate statistics using subgroups identified by more than one series.

I'll experiment with trying to do this using some more complex coding.

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

Re: By-group statistics

Postby EViews Gareth » Wed Jan 07, 2009 11:00 am

The statby command does what you want.
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 12 guests