Modify a variable

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

mpsc19
Posts: 26
Joined: Mon Jul 10, 2017 8:41 am

Modify a variable

Postby mpsc19 » Fri Nov 03, 2017 5:32 pm

Sorry for my english. Im using Eviews 7.
The image shows a single individual in four periods of time, where the variable "anedhijos" shows the years of education of that individual and the variable "anedpadres" shows the years of education of that individual's father. As can be seen in these two variables, it is not logical that in one quarter the individual has zero years of education and in the following quarter he has eight years of education. This is an error of the data, and what I'm looking for is some way that with a function you can make these zeros correct and put the number that corresponds in all periods, that is, for example,
that in all the quarters for the variable "anedhijos" appear the number 8. Can it be done? Thanks.

Image

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

Re: Modify a variable

Postby EViews Gareth » Fri Nov 03, 2017 5:44 pm

Have all individuals finished education during all periods in the sample?
Follow us on Twitter @IHSEViews

mpsc19
Posts: 26
Joined: Mon Jul 10, 2017 8:41 am

Re: Modify a variable

Postby mpsc19 » Fri Nov 03, 2017 6:10 pm

According to what I understood from your question, yes, those years of education are those that are complete, if you are studying at that time to have, for example, nine years of education, the variable will only be eight years because they are the years that has completed

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

Re: Modify a variable

Postby EViews Gareth » Fri Nov 03, 2017 6:24 pm

Code: Select all

anedhijos  = @maxsby(anedhijos, @crossid)
Follow us on Twitter @IHSEViews

mpsc19
Posts: 26
Joined: Mon Jul 10, 2017 8:41 am

Re: Modify a variable

Postby mpsc19 » Fri Nov 03, 2017 6:51 pm

Thanks!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 26 guests