Page 1 of 1

Changing single data point in time series

Posted: Tue Aug 20, 2019 3:47 am
by destofante
I am fetching a recession dummy for the Eurozone from the Haver database:

fetch(d=G10) N025VRM2

My problem is that, for the specific analysis I am conducting, I'd like to treat the first half of 2003 as a recession (Eurozone GDP contracted in Q1, and was virtually flat in Q2). So I'd like to add a simple routine to my program to overwrite the series at 2003Q1 and 2003Q2 setting it equal 1, without doing it manually every time. It must be simple... yet... :-D
Any tip?

Thank you all in advance!

Adolfo

Re: Changing single data point in time series

Posted: Tue Aug 20, 2019 6:56 am
by startz
There is probably a more elegant way, but how about

Code: Select all

smpl 2003Q1 2003Q2 N025VRM2 = 1 smpl @all

Re: Changing single data point in time series

Posted: Tue Aug 20, 2019 9:36 am
by EViews Matt
Which I believe you can rewrite as a one-liner:

Code: Select all

N025VRM2.fill(o=2003q1) 1, 1