donordata_to_individual: Convert single individual from donor data to class individual

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/donordata_to_individual.R

Description

This function takes data from the donordata package, extract cases identified by id and save as a an object of class individual. The function automatically calculates standard deviation scores and broken stick conditional means per visit.

Usage

1
2
3
donordata_to_individual(con = NULL, dnr, id, ...)

donordata.to.individual(con = NULL, dnr, id, ...)

Arguments

con

A database connection. The default con = NULL reads the data from the donordata package.

dnr

A character indicating the source, e.g. dnr = "smocc"

id

the id number of the individual in specified source. If specified as a vector, only the first element is used.

...

Additional parameter passed down to new("xyz",... ) and new("bse",... ). Useful parameters are models = "bsmodel" for setting the broken stick model, or call = as.call(...) for setting proper reference standards.

Value

An object of class individual. If id is not found in data dnr, then the function will set only slots id and dnr.

Note

donordata.to.individual() is deprecated, but exported for legacy reasons

Author(s)

Stef van Buuren 2017

See Also

xyz-class, bse-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
require("donorloader")
smocc <- load_data(dnr = "smocc")
smocc_bs <- load_data(dnr = "smocc_bs")
lollypop <- load_data(dnr = "lollypop")
terneuzen <- load_data(dnr = "terneuzen")
terneuzen_bs <- load_data(dnr = "terneuzen_bs")

p <- donordata_to_individual(dnr = "smocc", id = 10001)

# from lollypop
# calculating Z-score relative to preterm growth references
q <- donordata_to_individual(dnr = "lollypop", id = 50001)

# use models argument to estimate brokenstick estimates
p <- donordata_to_individual(dnr = "terneuzen", id = 11,
  models = "terneuzen_bs")

stefvanbuuren/minihealth documentation built on March 11, 2021, 7:10 p.m.