Page 1 of 1

Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 3:07 pm
by agarwaldvk
Hi


I have a working with the data set comprising of 4 variables viz Date (Daily), usageValues, Temperature and WeekDayFlag(0 Or 1 valued).

The date period is from 1st of January 2016 through to 7th of November 2017.

I want to create 2 new data series, one for usage (say usage_new) and one for temperature (say temp_new) from the original series with the following conditions for both of them :-

1. WeekDayFlag = 1 and
2. ((Date Between 1st of April 2016 and 30th of September 2016) Or (Between 1st of April 2017 and 30th of September 2017))

Is there a way to do this?

Also, if there is, once created then are these independent of the original ones, that is, if I were to subsequently create another 2 series (as above but for a different set of conditions for WeekDayFlag and Dates), would the previously created series get affected by these new series?


Best regards

Deepak

Re: Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 3:11 pm
by EViews Gareth
Don't understand the question. Perhaps you could provide an example of a manually created variable?

Re: Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 3:25 pm
by agarwaldvk
Hi

The data set is like so :-
Date, Usage, AvgTemp, HolidayFlag
01/01/2016, 12560, 34.5,1
02/01/2016, 11598, 33,1
03/01/2016, 12248, 32,0
...
...
07/11/2017, 13256, 23.5,0

Importing this data as a structured data set resulted in 3 variables viz Usage, AvgTemp, HolidayFlag with a certain number of records.

I want to create a new series for Usage say Usage_New which essentially is a subset of the original data series and contains the relevant records meeting the condition that :-
1. HoldiayFlag = 0 And
2. Dates fall within the range of ((1st Apr 2016 And 30th Sep 2016) Or (1st Apr 2017 And 30th Sep 2017))

Hopefully that should make it clearer.

Re: Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 4:40 pm
by startz
something like

Code: Select all

series usage_new smpl 4/1/2016 9/30/2016 4/1/2017 9/30/2017 if weekdayflag=1 usage_new = usage

Re: Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 5:04 pm
by agarwaldvk
Hi startz


Thanks for your response. I will try that tonight!

Having said that, after creating the series "Usage_New" as per your advice, if I were to subsequently generate another series say Usage_New_1 for a different period range and a different weekdayflag value, would that, in any way impact the previously generated series or would these 2 series remain total independent of each other?


Best regards


Deepak

Re: Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 5:23 pm
by startz
The two series would be independent of one another.

Re: Create a new data series based on an existing one!

Posted: Wed Nov 22, 2017 5:31 pm
by agarwaldvk
Hi startz


Great stuff. Thanks for your help! I will find out if it works for me tonight and let you know!


Best regards


Deepak