Command Reference : Function Reference : Function Reference: A
  
 
@after
Indicator series for whether an observation postdates a given date.
Syntax: @after(d)
d: string, alpha
Return: series
Returns a series containing indicators for whether each observation postdates the corresponding date d.
For dates d that are of equal or lower frequency than the observation, the results are (0, 1) indicators of whether the observation is on or after the beginning of d.
For dates d that are of higher frequency than the observation, the (0, n) results reflect the fraction of the observation on or after the beginning of d.
Examples
Suppose that we have a quarterly workfile with data from 2020q1 to 2022q4 that we create with the command:
workfile q 2020 2022
The command
series after_y = @after("2021")
uses a lower-frequency “yearly” date to creates the series AFTER_Y containing the value 1 from 2021q1 through the end of the workfile, and 0 elsewhere.
Using a “quarterly” date,
series after_q = @after("2021q3")
creates the series AFTER_Q containing the value 1 beginning in 2021q3 through the end of the workfile, and 0 elsewhere.
The command using a higher frequency “monthly” date
series after_m = @after("2021m5")
generates the series AFTER_M containing the value 0 from 2020q1 through 2021q1, a fractional value for 2021q2, and the value 1 from 2021q3 through the end of the data.
For the fractional 2021q2 value, there are 61 days in 2021-May and 2021-June that are after the beginning of the “2021m5” date and 91 days in the full quarter, so the fractional value for 2021q2 is 61/91 = 0.67033.
Cross-references
See also @before and @during.