Skip to content
Prev 219692 / 398500 Next

P values

How do u calculated p values for a z test..

so far i ve done this

A = read.table("cw3_data.txt")

xbar = mean(A)
s = 1
n = 20
mu = 0

z.test = (xbar-mu)/(s/sqrt(n))

p.value = pnorm(abs(z.test))

error = qnorm(0.99)*s/sqrt(n)
left = xbar - error
right = xbar + error

and have got values off of it...but the values for p dont match up with
other sites that i have used to check it agaisnt..such as wolfram alpha
value i got was 0.7335039  when wolfram got 0.533.. any ideas where i ve
gone wrong?  cheers