Learn R Programming

RSurveillance (version 0.2.1)

adj.risk.sim: Adjusted risk for simulation models

Description

Calculates adjusted risk for given relative risk and population proportions. This is an intermediate calculation in the calculation of effective probability of infection for risk-based surveillance activities. This function is similar to Adj.risk, except is adapted for use with multiple simulations instead of single RR values.

Usage

adj.risk.sim(rr, ppr)

Arguments

rr

relative risk values (matrix of values, columns corresponding to the number of risk strata, rows corresponding to number of iterations for simulation )

ppr

population proportions corresponding to rr values (vector of equal length to columns in rr)

Value

matrix of adjusted risk values (in order corresponding to rr)

Examples

Run this code
# NOT RUN {
# examples for adj.risk.sim
its<- 10
risk.cat<- 3
rr<- matrix(0, nrow=its, ncol=risk.cat)
rr[,1]<- mc2d::rpert(its, 5,10,20)
rr[,2]<- mc2d::rpert(its, 2,3,5)
rr[,3]<- 1
ppr<- c(0.05, 0.2, 0.75)
adj.risk.sim(rr, ppr)
adj.risk.sim(matrix(c(5, 3, 1), nrow=1), matrix(c(0.1, 0.1, 0.8), nrow=1))
# }

Run the code above in your browser using DataLab