Create new time series object based on values of another
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
Create new time series object based on values of another
I'm new to Eviews and this user forum. I need help with the following to create a new time series object called B:
A is an existing time series object; B is a new calculated time series object
IF(A>(2089.71+70), B = A -70))
IF(A >(180+3.49), B=(A-3.49+0.035*180)/1.035))
IF(A<180, B=(A-3.49))
A is an existing time series object; B is a new calculated time series object
IF(A>(2089.71+70), B = A -70))
IF(A >(180+3.49), B=(A-3.49+0.035*180)/1.035))
IF(A<180, B=(A-3.49))
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Create new time series object based on values of another
Look at @recode()
Re: Create new time series object based on values of another
I did try recode but Eviews returned an error message about too many arguments.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new time series object based on values of another
You probably did something wrong.
Re: Create new time series object based on values of another
That's really insightful - I thought I had probably done something wrong when Eviews returned an error. Is there any advice you can provide beyond "you probably did something wrong"?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new time series object based on values of another
Not without out knowing what you did.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Create new time series object based on values of another
Well I know what you did.
You gave @recode more than 3 arguments.
You gave @recode more than 3 arguments.
Re: Create new time series object based on values of another
yes I gave @recode more than 3 arguments. How do I fix this if there are three categories (arguments)? Do I need to do each one at a time?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new time series object based on values of another
You will have to nest a couple of recodes inside each other.
Code: Select all
Series a = @recode(x<5, @recode(x<3, 10, 20), 30)
Re: Create new time series object based on values of another
thanks, I will give it a try.
Re: Create new time series object based on values of another
Greetings:
I have a similar problem.
I have two series
First series : Personal_Income ( $ )
Second series : Age ( years old )
i would like to make a group with two new series :
Personal_Income_Of_Young :: Income of people below 25
Personal_income_Of_Old :: income of people above 50
If i could get these new series into a group , then i could call .testbtw and
get stats on the differences in these two age groups
there seems to be no way to "Freeze" a smpl command after i create one of
the new series.
Hope this is understandable ..
Many thanks for any hints or advice --!
I have a similar problem.
I have two series
First series : Personal_Income ( $ )
Second series : Age ( years old )
i would like to make a group with two new series :
Personal_Income_Of_Young :: Income of people below 25
Personal_income_Of_Old :: income of people above 50
If i could get these new series into a group , then i could call .testbtw and
get stats on the differences in these two age groups
there seems to be no way to "Freeze" a smpl command after i create one of
the new series.
Hope this is understandable ..
Many thanks for any hints or advice --!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new time series object based on values of another
What you're describing doesn't really fit in with the structure of EViews.
All series in a workfile page have the same structure - the same number of observations.
So you have two series:
Which means you have 5 observations. Any new series you create will also have 5 observations. So in your case where you say you want to create a series that will contain income information for those under 25, what would the other 3 observations be?
All series in a workfile page have the same structure - the same number of observations.
So you have two series:
Code: Select all
Income Age
10,000 25
12,000 23
34,000 45
56,000 60
13,000 22
Re: Create new time series object based on values of another
thanks for the reply - I would NOT have 5 samples any more, I would have two unequal series
I found that I could create two (unequal length ) vectors and then do the
required stats on the vectors with my own code, but could not get
Groups to accept vectors as members so I could not call .testbtw on the group members .
I will try the "stats by classification " -
Oh well, thanks for the confirmation that my approach needs reconsideration
I found that I could create two (unequal length ) vectors and then do the
required stats on the vectors with my own code, but could not get
Groups to accept vectors as members so I could not call .testbtw on the group members .
I will try the "stats by classification " -
Oh well, thanks for the confirmation that my approach needs reconsideration
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Create new time series object based on values of another
I think a specific solution to your overall problem would be to do the following:
- Create an indicator series that is equal to 1 for young people, 0 for middle aged and 2 for old people:
Code: Select all
series indicator = @recode(age>50,2, @recode(age<25,1,0)) - set the sample to be if indicator>0 (i.e. only young or old people):
Code: Select all
smpl if indicator>0 - Open up the income series and click on View->Descriptive Statistics->Equality Tests by Classification, and enter Indicator as the classifying series.
Who is online
Users browsing this forum: No registered users and 2 guests
