Trend | R Documentation |
Compute variable x with trend t for year y
Trend(t, y, x, z)
t |
trend rate |
y |
time increment |
x |
first value |
z |
type of trend 0 or 1 |
NJS: created 7/9/02. Original VB code: Function Trend(t As Double, y, x As Double, z) As Double t is trend rate, y is time increment, x is first value, z is type of trend
If z = 0 Then Trend = x * (1 + t) ^ y ElseIf z = 1 Then Trend = x + (y * t) Else If Trend < 0 Then Trend = 0
Print "Unknown trend/cycle function" Stop End If
End Function
trend variable (scalar or vector) EEH: changed to work with vectors of y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.