Skip to content
Prev 311772 / 398503 Next

Student-t distributed random value generation within a confidence interval?

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.