Skip to content
Prev 219763 / 398500 Next

P values

Why

s = 1 

##

s = sd(A) #?


-----Urspr?ngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von level
Gesendet: Mittwoch, 5. Mai 2010 22:41
An: r-help at r-project.org
Betreff: [R] 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