Description Usage Arguments Value Methods (by class) Examples
View source: R/is_applicable_to_covset.R
Check if any of the given equation(s) can be applied to the supplied set of covariates
1 2 3 4 5 6 7 | is_applicable_to_covset(x, cov)
## S3 method for class 'eq'
is_applicable_to_covset(x, cov)
## S3 method for class 'eqs'
is_applicable_to_covset(x, cov)
|
x |
equation(s set/bag) object |
cov |
(chr) vector of covariates |
(lgl) TRUE if the covariates supplied are a subset of the
covariates needed to solve at least one of the equations in
x
.
eq
: Check if the eq
uation can
be applied to the cov
ariates supplied.
eqs
: Check if (all) the
eq
uations in the eqs
object can be
applied to the cov
ariates supplied.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(equationer)
eq_test <- eq(age = 0.1, bmi = -0.3,
name = "first eq_test",
outcome = "kcal/day"
)
is_applicable_to_covset(eq_test, c("age", "bmi")) # TRUE
is_applicable_to_covset(eq_test, c("age", "bmi", "sex")) # TRUE
is_applicable_to_covset(eq_test, c("age")) # FALSE
is_applicable_to_covset(eq_test, c("age", "sex")) # FALSE
library(equationer)
eq_test <- eq(age = 0.1, bmi = -0.3,
name = "eq_test",
outcome = "kcal/day",
strata = list(sex = "female")
)
eq2_test <- eq(age = 0.1, bmi = -0.3,
name = "eq2_test",
outcome = "kcal/day",
strata = list(sex = "male")
)
eqs_test <- eqs(eq_test, eq2_test, name = "eqs-test")
is_applicable_to_covset(eqs_test, c("age", "bmi")) # TRUE
is_applicable_to_covset(eqs_test, c("age", "bmi", "sex")) # TRUE
is_applicable_to_covset(eqs_test, c("age")) # FALSE
is_applicable_to_covset(eqs_test, c("age", "sex")) # FALSE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.