eq: Single equation object

Description Usage Arguments Value Methods (by generic) Examples

View source: R/eq.R

Description

Constructor for object of class eq defined by its (named) coefficients.

Usage

1
2
3
4
eq(..., name, outcome, strata = vector("list"))

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

Arguments

...

sequence of named coefficients

name

(chr) the name of the equation

outcome

(chr) the outcome produced by the equation

strata

(list, default = empty list) if the equation is one of a set of equations defined each one for a combination of level of some strata variables, strata is a list for those levels (named with strata names)

x

an object used to select a method

Value

an eq 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
eq1 <- eq(female = 2, age = 0.3, bmi = -0.21,
    name = "cl_test_1",
    outcome = "kcal/day"
)

# works with strata
eq2 <- eq(age = 0.3, bmi = -0.5,
    name = "cl_test_1",
    outcome = "kcal/day",
    strata = list(sex = "female")
)
eq3 <- eq(age = 0.5, bmi = -0.3,
    name = "cl_test_1",
    outcome = "kcal/day",
    strata = list(sex = "male")
)

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

eq(age = 0.5, bmi = -0.3, name = "eq_test", outcome = "kcal/day")

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