Re: [R] z.test for dataframe

2012-10-17 Thread Balqis
wow, thanks for the informative inputs! I'm glad I post that silly question..thanks! On Wed, Oct 17, 2012 at 6:51 PM, Greg Snow <538...@gmail.com> wrote: > Rui answered the main question by pointing out that you need z.test(m, > stdev=s(m)), or you could use z.test(m,,sd(m)), but I think the stde

Re: [R] z.test for dataframe

2012-10-17 Thread Greg Snow
Rui answered the main question by pointing out that you need z.test(m, stdev=s(m)), or you could use z.test(m,,sd(m)), but I think the stdev= approach is clearer. But you are really abusing the concept of z tests in general (and the z.test function in particular) by using the sd of the sample. If

Re: [R] z.test for dataframe

2012-10-17 Thread R. Michael Weylandt
On Wed, Oct 17, 2012 at 7:45 AM, Balqis wrote: > Sep=cbind(kIp,k02p,k04p,k07p) > Sep=as.data.frame(Sep) > I see Rui has already taken a stab at your question, but I just want to chime in to say the preceeding is really a terrible idiom. It would be much _much_ better to write Sep = data.frame(kl

Re: [R] z.test for dataframe

2012-10-17 Thread Rui Barradas
Hello, Without a data example I can't test this but, the call to ?z.test seems to be wrong, you are passing a value for argument 'mu' equal to sd(m) but _not_ passing a value for argument 'stdev'. Try kzt <- sapply(Sep, function(m) z.test(m, stdev = sd(m))) Hope this helps, Rui Barradas Em