allvals <- rt(1000,df=11)  
## 1000 samples is overkill: slightly more than 
##    500*(1.05) should be large enough
subvals <- (allvals[abs(allvals)<qt(0.975,df=11)])
vals &lt;- m+subvals[1:500]*s/sqrt(n)

I'm subsetting before transforming, it seems slightly easier.
&lt;/quote>

Thank you very much bbolker. It works very well!

Best regards
Thomas



--
View this message in context: 
http://r.789695.n4.nabble.com/Student-t-distributed-random-value-generation-within-a-confidence-interval-tp4650561p4650640.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to