ttest | R Documentation |
intRvals
Performs one and two sample t-tests on objects of class intRvals
ttest( x, y = NULL, alternative = c("two.sided", "less", "greater"), mu = 0, var.equal = FALSE, conf.level = 0.95 )
x |
an object of class |
y |
an (optional) object of class |
alternative |
a character string specifying the alternative hypothesis, must be one of " |
mu |
a number indicating the true value of the mean (or difference in means if you are performing a two sample test). |
var.equal |
a logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise the Welch (or Satterthwaite) approximation to the degrees of freedom is used. |
conf.level |
confidence level of the interval |
alternative = "greater"
is the alternative that x
has a larger mean than y
.
If the input data are effectively constant (compared to the larger of the two means) an error is generated.
A list with class "htest
" containing the same components as in t.test
data(goosedrop) dr=estinterval(goosedrop$interval) # perform a one-sample t-test ttest(dr,mu=200) #> FALSE, true mean not equal to 200 # two sample t-test data.beforeMay=goosedrop[goosedrop$date<as.POSIXct('2013-05-01'),] data.afterMay=goosedrop[goosedrop$date>as.POSIXct('2013-05-01'),] dr.beforeMay=estinterval(data.beforeMay$interval) dr.afterMay=estinterval(data.afterMay$interval) ttest(dr.beforeMay,dr.afterMay)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.