View source: R/seasonal_trend.R
seasonal_trend | R Documentation |
This function generates a time trend for given time points in the trial according to a periodic function.
seasonal_trend(j, lambda, n_wave, n_total, trend_mean, trend_var)
j |
Time points for which the trend should be generated. |
lambda |
Strength of time trend. |
n_wave |
How many cycles (waves) should the time trend have ( |
n_total |
Total sample size in the trial. |
trend_mean |
Integer. In case of random time trends, the strength of the time trend will be generated from N( |
trend_var |
Integer. In case of random time trends, the strength of the time trend will be generated from N( |
The time trend is generated according to the function f(j) = \lambda \cdot \mathrm{sin} \big( \psi \cdot 2\pi \cdot \frac{j-1}{N-1} \big)
, where N
is the total sample size (parameter n_total
) and the parameter \psi
corresponds to the input parameter n_wave
.
Time trend for time points j.
Marta Bofill Roig, Pavla Krotka
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.