Learn R Programming

IRTpp (version 0.2.6.1)

rtnorm: Truncated normal simulation

Description

Truncated normal simulation

Usage

rtnorm(n, mean = 0, sd = 1, lower = -Inf, upper = Inf)

Arguments

n
length of the vector simulated
mean
mean of the normal simulated
sd
Standard deviation of the normal simulated
lower
lower boundary of the normal simulated
upper
upper boundary of the normal simulated

Value

the simulated value of the normal truncated

References

Robert, C. P. Simulation of truncated normal variables. Statistics and Computing (1995) 5, 121-125

Examples

Run this code
# rtnorm(100, 50, 12, lower = 48)
# rtnorm(100, 50, 12, lower = 48, upper = 56)

Run the code above in your browser using DataLab