Description Usage Arguments Value See Also Examples
This function approximates intercept (β_{0})
iteratively to get a balanced case-control ratio in the simulated data.
This function uses simstudy
package.
1 | find_intercept_iter(true_beta, dtx_old, ccr = 0.5, ...)
|
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). |
A list of
data
: The new data.table with outcome column data$out
.
intercept
: An estimation of the intercept.
difference
: The absolute difference between ccr
and mean(data$out)
.
sequence
: Sequence of tested intercepts.
ccr
: Case-to-control ratio for each intercept.
defDataAdd
and
addColumns
in simstudy
package.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.