test_relations: Generate tibble of covariate relations to test

View source: R/stepwise-covariate.R

test_relationsR Documentation

Generate tibble of covariate relations to test

Description

[Stable]

The goal of NMproject's covariate modelling functions is to provide a stepwise covariate method with manual decision making. This important to ensure that the full model selection/evaluation criteria (should be defined in statistical analysis plans) can be applied at every step rather than just log likelihood ratio testing, where the most significant model may be unstable, may worsen model predictions or may only be slightly more significant than a more physiologically plausible covariate relationship.

The functions test_relations(), covariate_step_tibble(), bind_covariate_results() together comprise NMproject stepwise covariate method with manual decision. The goal is to be part way between PsN's SCM and completely manual process at each forward and backward elimination step. The syntax of how covariates are included is the same as PsN's SCM routine - See PsN documentation for more information.

Usage

test_relations(dtest, param, cov, state, continuous)

Arguments

dtest

Optional existing dtest to append (from an previous use test_relations()).

param

Character. Name of parameter(s).

cov

Character. Name of covariate(s).

state

Numeric or character. Number/name of state (see details).

continuous

Logical (default = TRUE). If FALSE, will treat the covariate as categorical.

Details

Setting vector values for param, cov, and state, will expand the grid to test each value with every other value greedily. This is similar to expand.grid() available states (see also add_cov()):

"2" or "linear"

PARCOV= ( 1 + THETA(1)*(COV -median))

"3" or "hockey-stick"

IF(COV.LE.median) PARCOV = ( 1 + THETA(1)*(COV - median)) IF(COV.GT.median) PARCOV = ( 1 + THETA(2)*(COV - median))

"4" or "exponential"

PARCOV= EXP(THETA(1)*(COV - median))

"5" or "power"

PARCOV= ((COV/median)**THETA(1))

"power1"

PARCOV= ((COV/median))

"power0.75"

PARCOV= ((COV/median)**0.75)

"6" or "log-linear"

PARCOV= ( 1 + THETA(1)*(LOG(COV) - log(median)))

Value

A tibble describing relationships to test.

See Also

add_cov(), covariate_step_tibble(), bind_covariate_results()

Examples


dtest <- test_relations(param = c("KA", "K", "V"),
                        cov = c("LIN1", "LIN2", "LIN3", "RND1", "RND2", "RND3"),
                        state = c("linear", "power"),
                        continuous = TRUE) %>%
         test_relations(param = c("KA", "K", "V"),
                        cov = "BN1",
                        state = "linear",
                        continuous = FALSE)

dtest

NMproject documentation built on Sept. 30, 2022, 1:06 a.m.