Last data update: 2014.03.03

R: Estimation of relative risk
rrcalcR Documentation

Estimation of relative risk

Description

rrcalc caculates relative risks below and above a threshold. Relative risks and the 95% C.I.s of lower unit and upper unit based on the threshold are estimated.

Usage

rrcalc(object, rrunit = 1)

Arguments

object

a fitted threshpt object produced by threshpt().

rrunit

Unit of relative risk.

Details

In GLM with log link, the coefficients of the exposure are equal to log values of RR. rrcalc gives relative risks in log link GLM, particularly, Poisson regression model.

Value

The results of "<Threshold" mean that the relative risk and 95% confidence interval when the exposure increases by rrunit below threshold. The results of ">=Threshold" mean those when the exposure increases by rrunit above threshold.
RR = exp(beta*rrunit) and 95% C.I = exp((beta-1.96*s.e(beta), beta+1.96*s.e(beta))*rrunit)

Author(s)

Youn-Hee Lim, Il-Sang Ohn, and Ho Kim

Examples

# read the Seoul data set and create lag variables
data(mort)
seoul = read6city(mort, 11)
seoul_lag = lagdata(seoul, c("meantemp", "mintemp", "meanpm10", "meanhumi"), 5)

# find a optimal threshold and conduct piecewise linear regression
mythresh = threshpt(nonacc ~ meantemp_m3 + meanpm10_m2 +  meanhumi + ns(sn, 4*10) + factor(dow), 
			     expvar = "meantemp_m3", family = "poisson", data = seoul_lag,
			     startrng = 23, endrng = 33, searchunit = 0.2)


# calculate relative risks
rrcalc(mythresh)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HEAT)
Loading required package: splines
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HEAT/rrcalc.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rrcalc
> ### Title: Estimation of relative risk
> ### Aliases: rrcalc
> 
> ### ** Examples
> 
> # read the Seoul data set and create lag variables
> data(mort)
> seoul = read6city(mort, 11)
> seoul_lag = lagdata(seoul, c("meantemp", "mintemp", "meanpm10", "meanhumi"), 5)
> 
> # find a optimal threshold and conduct piecewise linear regression
> mythresh = threshpt(nonacc ~ meantemp_m3 + meanpm10_m2 +  meanhumi + ns(sn, 4*10) + factor(dow), 
+ 			     expvar = "meantemp_m3", family = "poisson", data = seoul_lag,
+ 			     startrng = 23, endrng = 33, searchunit = 0.2)
> 
> 
> # calculate relative risks
> rrcalc(mythresh)
                   RR 95% Lower CI. 95% Upper CI
<Threshold  0.9994901     0.9977038     1.001280
>=Threshold 1.0185862     1.0121592     1.025054
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>