Title: | Statistical Analysis and Programming |
---|---|
Description: | The Hypothesis tests for the means of independent or paired groups. This package investigates the normality assumption automatically. Then, it tests the hypothesis tests for two independent or paired group means by using parametric or non-parametric tests. It uses the Shapiro-Wilk test to test the normality assumption. For independent two groups, If data comes from the normal distribution, the package uses the Z or t-test according to whether variances are known. For paired groups, it uses paired t-test under normal data sets. If data does not come from the normal distribution, the package uses the Wilcoxon test for independent and paired cases. |
Authors: | Hasan Bulut [aut, cre] |
Maintainer: | Hasan Bulut <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2025-02-27 02:45:01 UTC |
Source: | https://github.com/cran/SAP |
The data set is used in Sample 16.1. The data set consists of 2 variables and 10 observations. This data is imaginary.
data1
data1
Tests for means of two independent or paired groups.
TwoSamplesMeans( x, y, var.equal = FALSE, H1 = "two.sided", xvar = NULL, yvar = NULL, paired = FALSE )
TwoSamplesMeans( x, y, var.equal = FALSE, H1 = "two.sided", xvar = NULL, yvar = NULL, paired = FALSE )
x |
a numeric vector for the data of the first group. |
y |
a numeric vector for the data of the second group. |
var.equal |
a logical variable indicating whether to treat the two variances as being equal |
H1 |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), |
xvar |
a numeric value for the variance of the first group |
yvar |
a numeric value for the variance of the second group |
paired |
a logical indicating value whether you want |
TwoSamplesMeans
function performs hypothesis
tests on means of independent or paired two
groups. Moreover, this function can decide whether it
will use a parametric or non-parametric test.
a list with 3 elements:
statistic |
the value of the test statistic |
df |
If it is available, the degree of freedom for the test statistic |
p.value |
the p-value for the test |
test |
a character string indicating which method was used |
Hasan BULUT <[email protected]>
x<-c(10, 25, 35, 40, 70, 60, 50, 70, 65, 25) y<-c(30, 20, 60, 70, 50, 90, 80, 65, 75, 60) TwoSamplesMeans(x = x,y = y,H1 = "two.sided")
x<-c(10, 25, 35, 40, 70, 60, 50, 70, 65, 25) y<-c(30, 20, 60, 70, 50, 90, 80, 65, 75, 60) TwoSamplesMeans(x = x,y = y,H1 = "two.sided")