Generate series by sort

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

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

Lalan_dk
Posts: 3
Joined: Tue Apr 10, 2018 9:51 pm

Generate series by sort

Postby Lalan_dk » Wed Apr 11, 2018 6:54 pm

Hello

I'm using IFLS data that contains more than 15000 household data and every household has some person. I want to get the oldest age of person in every household. My friend teach me to use stata with syntax:

Code: Select all

 Bysort hhid14: egen maxage=max(age)


With hhid14 is household id
maxage is series to be generated (maximum age of every household)
age is the age data of every person

But i'm not a stata user. I'm eviews user. And i can't find the bysort command in eviews.

How can i generate series like that? Or there is same bysort command in eviews with different name or word?

startz
Non-normality and collinearity are NOT problems!
Posts: 3268
Joined: Wed Sep 17, 2008 2:25 pm

Re: Generate series by sort

Postby startz » Wed Apr 11, 2018 7:40 pm

Look at @maxsby in the help system.

Lalan_dk
Posts: 3
Joined: Tue Apr 10, 2018 9:51 pm

Re: Generate series by sort

Postby Lalan_dk » Wed Apr 11, 2018 10:45 pm

Ok, thank you startz..

Then, if I would like to generate lagged series in every household, what command that should I use?

like: if a household has 5 members, and their age is 1; 2; 3; 4; 5, I would like to make series that contain age(-1), that is NA;1;2;3;4. The household id is an alphanumeric (text) data and i want to do this for more than 15000 household. please help

startz
Non-normality and collinearity are NOT problems!
Posts: 3268
Joined: Wed Sep 17, 2008 2:25 pm

Re: Generate series by sort

Postby startz » Thu Apr 12, 2018 6:10 am

That one's a little harder, something like

Code: Select all

series laggedage = @recode(householdid = householdid(-1),age(-1),na)_


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 8 guests