Page 1 of 1

Delete value of a certain observation from a series

Posted: Thu Oct 27, 2022 2:13 pm
by miorinnovo
Hello.

How can a take a series and subtract the value of a specific date from all observations.

For example, a series of annual data with three observations 2019= 1, 2020=3, 2021=5

How do I create new series where I'm removing the 2020 value from all 3 years? I could just subtract 3 but I'd like it to find the value of that observation so its more flexible.

Thanks!

Re: Delete value of a certain observation from a series

Posted: Thu Oct 27, 2022 4:33 pm
by EViews Gareth

Code: Select all

series new_x = x - @elem(x, "2000")

Re: Delete value of a certain observation from a series

Posted: Thu Oct 27, 2022 5:14 pm
by miorinnovo
Fantastic, thanks