Dear Eviews users. I'm using Eviews 7.0. I have a panel data with 94 cross sections with information collected for each of 19 days. One of the key variables of the study could have zeros, one or several days. In order to identify the occurrence of values different from zero I made a new variable "X" with assign a value of one if the value of the key variable is different from zero and a zero otherwise.What I need now is to create a new variable "Y" that contains the sum of ones from "X". So for example my id 1 has only one value different from zero and then "Y" should have 19 values of 1, my id2 has three different values and "Y" should have 19 values of 3, and so on.
Any help will be appreciated in order to generate "Y".
new variable with sum of values
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13306
- Joined: Tue Sep 16, 2008 5:38 pm
Re: new variable with sum of values
Code: Select all
series y = @sumsby(x, @crossid)
Follow us on Twitter @IHSEViews
Re: new variable with sum of values
thanks! Gareth where can I find a list of such useful commands like @sumsby?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13306
- Joined: Tue Sep 16, 2008 5:38 pm
Re: new variable with sum of values
By-Group Statistics section of Chapter 13 of the Command Reference.
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 15 guests