Analysis: t test to compare means with a reference value
Analysis: t test to compare means with a reference value
Sometimes the researcher wants to test whether the treatment mean is greater than/equal to or less than a reference value. For example, I want to know if the average productivity of my treatment is higher than the average productivity of a given country. For this, this function allows comparing the means with a reference value using the t test.
tonetest(response, trat, mu =0, alternative ="two.sided", conf.level =0.95)
Arguments
response: Numerical vector containing the response of the experiment.
trat: Numerical or complex vector with treatments
mu: A number indicating the true value of the mean
alternative: A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less"
conf.level: confidence level of the interval.
Returns
returns a list with the mean per treatment, maximum, minimum, sample standard deviation, confidence interval, t-test statistic and its p-value.
Note
No treatment can have zero variability. Otherwise the function will result in an error.