z.test for dataframe
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 17-10-2012 07:45, Balqis escreveu:
Hi! I'm trying to use sapply to my dataframe for z.test function (teaching demos package) Sep=cbind(kIp,k02p,k04p,k07p) Sep=as.data.frame(Sep) kzt=sapply(Sep, function(m) z.test(m,sd(m))) Error in z.test(m, sd(Sep)) : You must specify a Standard Deviation of the population kzt=sapply(Sep, function(m) z.test(m,sd(Sep))) Error in z.test(m, sd(Sep)) : You must specify a Standard Deviation of the population #obviously it can't process the z.test because of the sd function embedded inside the function. can someone point me how to fix this. Many thanks! [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.