override_static: Override static variable

Description Usage Arguments Examples

Description

An internal function not intended for the user. For static variables, overrides any time-varying values to ensure that they are actually static.

Usage

1
override_static(.static.var.name, .id.var.name = "id", .d, .obs)

Arguments

.static.var.name

Name of static variable.

.id.var.name

Name of variable defining clusters in dataset.

.d

Dataset

.obs

The number of observations per cluster.

Examples

1
2
3
4
5
# example with 10 subjects each with 3 observations
# generate sex in a way where it might vary within a subject
data = data.frame( id = rep(1:10, each=3),
                   male = rbinom( n=10*3, size=1, prob=0.5 ) )
override_static("male", "id", data, 3)

SimTimeVar documentation built on May 2, 2019, 8:31 a.m.