@trendc |

Calendar trend.

Syntax: @trendc([d])

d: (optional) date or observation

Return: series

Returns a calendar time trend that increases by the number of calendar periods between successive observations.

The optional date or observation d may be provided to indicate the starting point (with a 0 value) for the trend. If d omitted, the starting point is assumed to be the earliest observation in the workfile.

• In a regular frequency workfile, @trend and @trendc both return a simple trend that increases by one for each observation of the workfile.

• In an irregular workfile, @trend provides an observation-based trend as before, but @trendc now returns a calendar trend that increases based on the number of calendar periods between adjacent observations. For example, in a daily irregular file where a Thursday has been omitted because it was a holiday, the @trendc value would increase by two between the Wednesday before and the Friday after the holiday, while @trend will increase by only one.

This function is panel aware. For a panel trend function that uses only the observed dates, use
@trend. For a simple panel trend in which values begin at 1 and sequentially increase by 1, you may use the
@obsid function.

Examples

series t = @trend

creates a calendar trend series starting at 0 in the first workfile observation.

series t90q1 = @trend("1990q1")

creates a calendar trend series based at 0 in 1990q1.

Cross-references