Combine @sumsby with sample command
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
Combine @sumsby with sample command
Is it possible to combine the @sumsby command with the sample command? I wish to sum over a subgroups in one period in a panel-data set.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Combine @sumsby with sample command
Yes, the third argument of the command takes a sample.
http://www.eviews.com/help/helpintro.ht ... stics.html
http://www.eviews.com/help/helpintro.ht ... stics.html
Follow us on Twitter @IHSEViews
Re: Combine @sumsby with sample command
That is not exactly what I need.
I have a state-skill combination as the cross-sectional dimension. Now I wish to sum up the values of a series for some of the skills in one state at one point in time.
I have a state-skill combination as the cross-sectional dimension. Now I wish to sum up the values of a series for some of the skills in one state at one point in time.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Combine @sumsby with sample command
Not entirely sure I follow, but don't you just want the @sum rather than @sumsby?
Code: Select all
scalar mysum = @sum(myseries, "1990m1 1990m1 if state-skill="CA fishing")
Follow us on Twitter @IHSEViews
Re: Combine @sumsby with sample command
I need to create a new series that sums up several observations at every point in time. In your example, that would be something like:
series SUM = CA_fishing + CA_hunting but other skills in CA (e.g. CA_farming) must not be included in the summation.
The series SUM then contains the same value for every skill in California.
This summations needs to be computed for each period, i.e. something like @obsid
series SUM = CA_fishing + CA_hunting but other skills in CA (e.g. CA_farming) must not be included in the summation.
The series SUM then contains the same value for every skill in California.
This summations needs to be computed for each period, i.e. something like @obsid
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Combine @sumsby with sample command
Code: Select all
series mysum = @sumsby(myseries, @obsid, if skill="fishing")
Perhaps providing a concrete example would help?
Follow us on Twitter @IHSEViews
Re: Combine @sumsby with sample command
The problem with your suggestion is that it sums up the values if skill=fishing over all states. What I need is that fishing and hunting are summed up in one state.
I solved the issue with a loop. However, it would be interesting to know if it was necessary.
I solved the issue with a loop. However, it would be interesting to know if it was necessary.
Who is online
Users browsing this forum: No registered users and 24 guests