%stat351_introduction2.m %p-values >>X = [1.0044 1.7164 -0.0153 -0.2653 1.4195 -1.0534 0.2733 -0.5767 1.1299 0.0296]; >> mean(X) ans = 0.3662 >> mean(X)*sqrt(10) ans = 1.1582 >> normcdf(-1.1582,0,1) ans = 0.1234 %Random binary sequence >> X=[1 1 1 0 1 1 0 1 1 0]' X = 1 1 1 0 1 1 0 1 1 0 >> mean(X) ans = 0.7000 >> help binocdf BINOCDF Binomial cumulative distribution function. Y=BINOCDF(X,N,P) returns the binomial cumulative distribution function with parameters N and P at the values in X. The size of Y is the common size of the input arguments. A scalar input functions as a constant matrix of the same size as the other inputs. The algorithm uses the cumulative sums of the binomial masses. >> binocdf(10,10,0.5) ans = 1 >> binocdf(3,10,0.5) ans = 0.1719 >> 1-binocdf(6,10,0.5) ans = 0.1719