Question: R questions Question 1. This is an example how to create a function in R which performs a two-sided hypothesis test of means in large

R questions Question 1. This is an example how to create a function in R which performs a two-sided hypothesis test of means in large samples ##Function for two-tailed hypothesis test in large samples set.seed(9) z.hyptest.twotail = function(muhyp,n,xbar,s,alpha) { zstar = qnorm(1-alpha/2) SE = s/sqrt(n) teststat = (xbar-muhyp)/SE p = 1-pnorm(teststat) print("critical value:") print(zstar) print("test statistic:") print(teststat) print("p-value:") print(p) if ((teststat>=-zstar) & (teststat
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
