Delete value of a certain observation from a series

For questions regarding programming in the EViews programming language.

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

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Delete value of a certain observation from a series

Postby miorinnovo » Thu Oct 27, 2022 2:13 pm

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!

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

Re: Delete value of a certain observation from a series

Postby EViews Gareth » Thu Oct 27, 2022 4:33 pm

Code: Select all

series new_x = x - @elem(x, "2000")
Follow us on Twitter @IHSEViews

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Delete value of a certain observation from a series

Postby miorinnovo » Thu Oct 27, 2022 5:14 pm

Fantastic, thanks


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests