sds: Calculate SDS Values

Description Usage Arguments Details Value Author(s) Examples

View source: R/sdsvals.r

Description

Calculate SDS values

Usage

1
2
sds(value, age, sex, item, ref, type = "SDS", male = "male",
  female = "female")

Arguments

value

vector of measurement values

age

vector of age values

sex

vector of sex

item

name of the item e.g. "height"

ref

RefGroup object

type

"SDS" or "perc"

male

coding of sex for male

female

coding of sex for female

Details

The function takes a vector of measurement values, and of age and of sex and a RefGroup object as arguments. It calculates the sds or percentile values.

Value

vector containing SDS or percentile values

Author(s)

Mandy Vogel

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
anthro <- data.frame(age = c(11.61,12.49,9.5,10.42,8.42,10.75,9.57,10.48),
                     height = c(148.2,154.4,141.6,145.3,146,140.9,145.5,150),
                     sex = sample(c("male","female"), size = 8, replace = TRUE),
                     weight = c(69.5,72.65,47.3,51.6,45.6,48.9,53.5,58.5))
anthro$height_sds <- sds(anthro$height,
                         age = anthro$age,
                         sex = anthro$sex, male = "male", female = "female",
                         ref = kro.ref,
                         item = "height",
                         type = "SDS")

anthro$bmi <- anthro$weight/(anthro$height**2) * 10000
anthro$bmi_perc <- sds(anthro$bmi,
                       age = anthro$age,
                       sex = anthro$sex, male = "male", female = "female",
                       ref = kro.ref,
                       item = "bmi",
                       type = "perc")
data(who.ref)
x <- data.frame(height=c(50,100,60,54),
                sex=c("m","f","f","m"),
                age=c(0,2.9,0.6,0.2))
sds(value = x$height, age = x$age, sex = x$sex, male = "m", female = "f",
    ref = who.ref, item = "height")

mvogel78/childsds documentation built on May 23, 2019, 10:55 a.m.