eqs: Multiple equation object

Description Usage Arguments Details Value Methods (by generic) Examples

View source: R/eqs.R

Description

Constructor for object of class eqs defined by its eqs components.

Usage

1
2
3
4
eqs(..., name, reference = NA_character_)

## S3 method for class 'eqs'
print(x, ...)

Arguments

...

(eq, only) sequence of equations

name

(chr) the name of the equations' set

reference

(chr, default NA) an optional reference for the set of the equations in the bag.

x

an object used to select a method

Details

All the equations included in the eqs object must share the same covariates and the same strata (with different combinations!)

Value

an eqs object

invisible x

Methods (by generic)

Examples

 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
eq1 <- eq(age = 0.3, bmi = -0.5,
    name    = "cl_test_1",
    outcome = "kcal/day",
    strata  = list(sex = "male")
)
eq2 <- eq(age = 0.5, bmi = -0.3,
    name = "cl_test_2",
    outcome = "kcal/day",
    strata  = list(sex = "female")
)

eqs1 <- eqs(eq1, eq2, name = "gendered-1")



# works with multiple strata
eq4 <- eq(age = 0.3, bmi = -0.5,
    name = "cl_test_4",
    outcome = "kcal/day",
    strata = list(sex = "male", mellitus = 0)
)
eq5 <- eq(age = 0.5, bmi = -0.3,
    name = "cl_test_5",
    outcome = "kcal/day",
    strata = list(sex = "female", mellitus = 0)
)
eq6 <- eq(age = 0.3, bmi = -0.3,
    name = "cl_test_6",
    outcome = "kcal/day",
    strata = list(sex = "male", mellitus = 1)
)
eq7 <- eq(age = 0.5, bmi = -0.5,
    name = "cl_test_7",
    outcome = "kcal/day",
    strata = list(sex = "female", mellitus = 1)
)

eqs2 <- eqs(eq4, eq5, eq6, eq7, name = "multistrata-1")
eq1 <- eq(age = 0.3, bmi = -0.5,
    name    = "cl_test_1",
    outcome = "kcal/day",
    strata = list(sex = "male", nyha = 1)
)

eq2 <- eq(age = 0.5, bmi = -0.3,                 # change strata wrt eq1
    name = "cl_test_2",
    outcome = "kcal/day",
    strata = list(sex = "female", nyha = 1)
)

eqs(eq1, eq2, name = "author19", reference = "A.Uthor et.al 2019")

UBESP-DCTV/equationer documentation built on Jan. 17, 2021, 6:30 p.m.