# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- library(stats) X = rnorm(10,mean=0,sd=2) t.test(X) X = rnorm(10,mean=1.5,sd=2) t.test(X) mean_zero_p_value = function(n=10,m=0,s=1){ X = rnorm(n,mean=m,sd=s) # generate data t.test(X)$p.value # return the p-value }