I?m faced with following problem:
Given is a sample where the sample size is 12, the sample mean is 30, and
standard deviation is 4.1.
Based on a Student-t distribution i?d like to simulate randomly 500 possible
mean values within a two-tailed 95% confidence interval.
Calculation of the lower and upper limit of the two-tailed confidence
interval is the easy part.
m <- 30 #sample mean
s <- 4.1 #standard deviation
n <- 12 #sample size
quant <- qt(0.975,df=11)*s/sqrt(n)#student-t with two tailed )95% confidence
interval
l <- m-quant# lower limit
h <- m+quant# upper limit
500 randomly simulated values are computable with the rt() command but this
command does not consider the 95% confidence interval.