Learn R Programming

stressaddition (version 3.1.0)

Stressconversion: Convert Between Stress and Survival

Description

Functions to convert survival to general stress or vice versa using the beta distribution.

Usage

survival_to_stress(survival, p = 3.2, q = 3.2)

stress_to_survival(stress, p = 3.2, q = 3.2)

Arguments

survival

One or more survival values to convert to general stress. Should be a value between 0 and 1. Smaller or bigger values are treated as 0 or 1 respectively.

p, q

The shape parameters of the beta distribution. Default is 3.2.

stress

One or more stress values to convert to survival.

Value

stress_to_survival returns a vector the same length as stress giving the survival caused by each amount of stress.

survival_to_stress returns a vector the same length as survival containing the stress values associated with each survival.

Details

These are simple wrappers around the beta distribution function pbeta and the beta quantile function qbeta.

Examples

Run this code
# NOT RUN {
stress <- 0.3
survival <- stress_to_survival(stress)
survival_to_stress(survival)

# }

Run the code above in your browser using DataLab