Learn R Programming

hypothesestest (version 1.0)

hypothesis: hypothesis test a claim

Description

a hypothesis test to test a claim about mu=H0 of a population.

Usage

hypothesis(TrnX = NULL, TrnY = NULL, m, u0, n1, n2, s1 = NULL, s2 = NULL, sigma1 = NULL, sigma2 = NULL, alpha = 0.05, method = "n", H0 = "u=u0", p)

Arguments

TrnX
the observed values of a random sample from a distribution which must be input as vectors
TrnY
the observed values of a random sample from another distribution which must be input as vectors
m
the mean of the bias of TrnX and TrnY
u0
the claim that H0: u=u0
n1
the amount of the sample TrnX
n2
the amount of the sample TrnY
s1
the standard deviation of the sample TrnX
s2
the standard deviation of the sample TrnY
sigma1
the standard deviation of the population TrnX
sigma2
the standard deviation of the population TrnY
alpha
the confident level of the hypothesis test
method
the distribution of the samples follow
H0
the claim about the population
p
p value which correspond to the z score

Value

refuse H0
at the confident level of alpha,we choose to refuse H0
we can not reject H0.
at the confident level of alpha,we choose not to refuse H0

Details

you can either input the original data of TrnX and TrnY,or just input s1,s2,n1,n2

See Also

conint

Examples

Run this code
## to test the claim
 hypothesis(TrnX=c(3,4,5),TrnY=c(4,5,6),m,u0=4,3,3,s1=NULL,s2=NULL,sigma1=NULL,sigma2=NULL,alpha=0.05,method="n",H0="u=u0",p)
# "we can not reject H0."
# "t is"
# 4.302673
# "Q is"
# 0
# "p-value is"
# 1

Run the code above in your browser using DataLab