find_intercept_iter: Find the Intercept for a Dataset

Description Usage Arguments Value See Also Examples

View source: R/sim_helpers.R

Description

This function approximates intercept (β_{0}) iteratively to get a balanced case-control ratio in the simulated data. This function uses simstudy package.

Usage

1
find_intercept_iter(true_beta, dtx_old, ccr = 0.5, ...)

Arguments

true_beta

A vector of true beta values including both assciated and non-associated variables.

dtx_old

Data.table of old dataset to be appended with outcome.

ccr

Numeric, case-control ratio (Default: 0.5).

cepts

A numeric list of intercepts to use, recommmended to be NULL (Default: NULL).

iter

Integer, number of increments between intercept limits (Default: 500).

Value

A list of

See Also

defDataAdd and addColumns in simstudy package.

Examples

1
2
3
dtx <- simstudy::genCorGen(n = 100, nvars = 5, params1 = 0.15,
 dist = "binary", wide = TRUE, rho = 0.1, corstr = "ar1")
find_intercept_iter(c(-2, -2, 2, 2, 2), dtx)

bips-hb/rgp documentation built on Feb. 3, 2021, 11:31 a.m.