Command Reference : Function Reference : Function Reference: T
  
 
@trend
 
Trend.
Syntax: @trend([d])
d: (optional) date or observation
Return: series
Returns a time trend that increases by one for each observation in the workfile.
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 date in the workfile.
This function is panel aware. In this context, trend values are defined sequentially across the entire set of available cross-section dates, and then matched to the individual cross-section dates. If there is a specific date that is missing in one cross-section, but is present in another, there will be a gap (non-sequential values) in the trend in the former. Thus, the panel trend may be thought of as a calendar trend that uses the calendar defined by dates observed in the workfile.
For a trend function that uses calendar dates, use @trendc. 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 trend series starting at 0 in the first workfile observation.
series t90q1 = @trend("1990q1")
creates a trend series based at 0 in 1990q1.
Cross-references
See also @trendbr and @trendc.