z.test <- function(x, y=NULL, sigmax, sigmay=sigmax, mu = 0, alternative="two.sided", conf.level=0.95 ) { # Orig: 3/11/2016 # Curr: 4/25/2019 ### This is the z-test for one and two samples. ### The input is standard. The test produces an ### object of class htest, as expected. # ### The input: ### x (and y, for two samples), the samples ### sigmax (and sigmay, for two samples), the pop stdev ### mu, the hypothesized population mean (for one sample) ### or difference (for two-samples) ### alternative, one of "two.sided" (default), "greater", or "less" ### conf.level (0.95 is default, corresponding to alpha = 0.05) # ### # Test for good input error <- "" if( sigmax <= 0 || sigmay<=0) { error="Error: Variance out of bounds" } if(0>conf.level || 1