DMKV.test: Z-test for the difference of means of two independent Normal...

View source: R/testscontrasteshipotesis.R

DMKV.testR Documentation

Z-test for the difference of means of two independent Normal variables with known population variances.

Description

Under the assumption that the data come from two independent Normal distributions, it performs the hypothesis test and the confidence interval for the difference of means with known population variances.

Usage

DMKV.test(x, y, difmu = 0, sdx, sdy,
          alternative = c("two.sided", "less", "greater"), conf.level = 0.95,
          ...)

Arguments

x

numerical vector (non-empty) that contains the data of the first sample.

y

numerical vector (non-empty) containing the data of the second sample.

difmu

numeric value indicating the value of the difference in population means between the two samples.

sdx

numerical value indicating the population standard deviation of the first sample, which is assumed to be known (mandatory).

sdy

numeric value indicating the population standard deviation of the second sample, which is assumed to be known (mandatory).

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

conf.level

confidence level of the interval.

...

further arguments to be passed to or from methods.

Value

A list with class "htest" containing the following components:

statistic

the value of the test statistic.

parameter

sample lengths and population standard deviations.

p.value

the p-value for the test.

conf.int

confidence interval for the difference of means with known population variances associated with the specified alternative hypothesis.

estimate

the estimated difference in means.

null.value

the specified hypothesized value of the mean difference.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating what type of statistical method was performed.

data.name

a character string giving the name(s) of the data.

See Also

t.test

Examples

data(cars93) # Data set provided with the package
# Maximum price difference (MaxPrice) in means between cars manufactured in the
# US and those manufactured outside, assuming that the variances are known and 
# equal to 64 and 169, respectively
var1<-subset(cars93, USA=="nonUS", select=MaxPrice)
var2<-subset(cars93, USA=="US", select=MaxPrice)
DMKV.test(var1, var2, sdx=13, sdy=8, difmu=0,
alternative="greater", conf.level=0.95)


RcmdrPlugin.TeachStat documentation built on Nov. 14, 2023, 5:08 p.m.