sw_trend: Generation of stepwise trend with equal jumps between periods

View source: R/sw_trend.R

sw_trendR Documentation

Generation of stepwise trend with equal jumps between periods

Description

This function generates a stepwise trend for a given period. No time trend is assumed in the first period.

Usage

sw_trend(cj, lambda, trend_mean, trend_var)

Arguments

cj

Period indicator.

lambda

Strength of time trend.

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 (c_j - 1), where c_j is an index of the period patient j was enrolled in.

Value

Time trend in period c_j.

Author(s)

Marta Bofill Roig, Pavla Krotka


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