linear_trend: Generation of a linear trend that starts in a given period

View source: R/linear_trend.R

linear_trendR Documentation

Generation of a linear trend that starts in a given period

Description

This function generates a time trend for given time points in the trial according to a linear function.

Usage

linear_trend(j, lambda, sample_size, trend_mean, trend_var)

Arguments

j

Time points for which the trend should be generated.

lambda

Strength of time trend.

sample_size

Vector of dimension 2, indicating sample size in the trial period until the time trend starts and the remaining sample size.

trend_mean

Integer. In case of random time trends, the strength of the time trend will be generated from N(trend_mean, trend_var).

trend_var

Integer. In case of random time trends, the strength of the time trend will be generated from N(trend_mean, trend_var).

Details

The time trend is generated according to the function f(j) = \lambda \cdot \frac{j-1}{N-1}, where N is the total sample size.

Value

Time trend for time points j.

Author(s)

Marta Bofill Roig, Pavla Krotka


pavlakrotka/NCC documentation built on April 17, 2025, 3:11 a.m.