> std.dev <- function(x) { std.x <- sqrt(var(x)); std.x; } > t.stat <- function(x) { n <- length(x) t <- sqrt(n)*(mean(x)-mu)/std.dev(x) list(t=t, p=2*(1- pt(abs(x), n-1))) } > unlist(t.stat(z,1))
Post a Comment
No comments:
Post a Comment