Learn R Programming

AgroR (version 1.3.6)

tonetest: 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)

Value

returns a list with the mean per treatment, maximum, minimum, sample standard deviation, confidence interval, t-test statistic and its p-value.

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.

Author

Gabriel Danilo Shimizu

Examples

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

Run the code above in your browser using DataLab