tonetest: Analysis: t test to compare means with a reference value

View source: R/tonetest_function.R

tonetestR Documentation

Analysis: t test to compare means with a reference value

Description

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.

Usage

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.

Value

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.

Author(s)

Gabriel Danilo Shimizu

Examples

library(AgroR)
data("pomegranate")
tonetest(resp=pomegranate$WL,
trat=pomegranate$trat,
mu=2,
alternative = "greater")

AgroR documentation built on May 29, 2024, 4:18 a.m.