[R] P values

2010-05-05 Thread level
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 i

[R] Expressing z & t test data in a graph

2010-05-05 Thread level
How do u do this? -- View this message in context: http://r.789695.n4.nabble.com/Expressing-z-t-test-data-in-a-graph-tp2131604p2131604.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz

[R] T-test & for loop

2010-05-05 Thread level
I have been set a question which i understand statistically but my inability with R is preventing me from finishing it.. My question is that we to calculate the frequency of Type 1 errors starting with x = rnorm(10, 0.1, 1) then doing a t-test seeing whether you reject the null hypothesis (Ho