Provides a one-sample hypothesis test. The test assumes that the underlying population is normal.
one.sample.t(data = NULL, null.mu = 0, xbar = NULL, sd, n = NULL,
alternative = "two.sided", conf = 0.95)
A vector of quantitative data. Not required if xbar
and n
are supplied by the user.
The expectation for the null distribution.
Sample mean. Not required if is.null(data)==FALSE
The sample standard deviation. Not required if is.null(data)==FALSE
The sample size. Not required if is.null(data)==FALSE
Type of test. One of three must be specified "two.sided", "less"
, or "greater"
Confidence level.
Returns a test statistic and a p-value.
The function can use either raw data is.null(data)==FALSE
or summarized data if is.null(data)==TRUE
. With the later xbar
, and n
must be specified by the user.
# NOT RUN {
one.sample.t(null.mu = 131, xbar = 126, sd = 12, n = 85,
alternative = "two.sided")
# }
Run the code above in your browser using DataLab