search for: kindtest

Displaying 1 result from an estimated 1 matches for "kindtest".

Did you mean: kindest
2005 Jul 05
1
by (tapply) and for loop differences
...lp? > # Simulate some data - I'll do 2 simulations... > > xvar = rnorm(40, 20, 5) > yvar = rnorm(40, 22, 2) > num = factor(rep(1:2, each=20)) > sdat = data.frame(cbind(num, xvar, yvar)) > > # Define a function to do a simple t test and return some values... > > kindtest = function(varx, vary){ + res = t.test(varx, vary) + x.mn = res$estimate[1] + y.mn = res$estimate[2] + diff = y.mn-x.mn + pval = res$p.value + cat("Mean xvar =", x.mn, " Mean yvar =", y.mn) + cat(" diff =", diff, " p-value=", pval, &quot...