dose: Functions related to manipulating yearly dose data

Description Usage Arguments Details Examples

Description

annualDoseToCumulativeDose Convert annual dose to cumulative dose with given id vector. The years associated with dose records for a given id should be in increasing order.

cumulativeDoseToAnnualDose Convert cumulative dose to annual dose with given id vector. The years associated with dose records for a given id should be in increasing order.

hsumaAnnualDose Generate dose realizations with annual dose records using hierachical SUMA model (with only multiplicative errors).

hsumaCumulativeDose Generate dose realizations with cumulative dose records using hierachical SUMA model (with only multiplicative errors).

Usage

1
2
3
4
5
6
7
annualDoseToCumulativeDose(dose, doseyr.id)

cumulativeDoseToAnnualDose(dose, doseyr.id)

hsumaAnnualDose(seed, uM, sM, pM, dose.mean, doseyr.id)

hsumaCumulativeDose(seed, uM, sM, pM, dose.mean, doseyr.id)

Arguments

dose

A vector describing year exposure, either annually or cumulative

doseyr.id

A vector describing the id information of the dose vector. Both dose and doseyr.id should be in increasing order with respect to doseyr.id

uM, sM, pM

Multiplicative error, unshared, shared and partially shared

dose.mean

Average dose vecotr

seed

Random seed to ensure reproducibility.

Details

Function cumulativeDoseToAnnualDose and annualDoseToCumulativeDose help with converting cumulative data to annual data and the other way around.

Function hsumaAnnualDose and hsumaCumulativeDose generates annual and cumulative dose replications using the SUMA model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
n <- 5000
n.year <- 10
id <- rep(1:n, each = n.year)
z.annual <- rchisq(n * n.year, 1)
z.cumulative <- annualDoseToCumulativeDose(z.annual, id)

z.annual.back <- cumulativeDoseToAnnualDose(z.cumulative, id)

all.equal(z.annual, z.annual.back)

um <- 0.5
sm <- 0.2

z.reps.annual <- hsumaAnnualDose(0, um, sm, 0, z.annual, id)
z.reps.cumulative <- hsumaCumulativeDose(0, um, sm, 0, z.cumulative, id)

zhuozhang/Rerr documentation built on May 4, 2019, 11:22 p.m.