Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

NAME :- Raunak Malkani DATE :- 13/01/2022

UID :- 20BIT032
Hypothesis Testing Parametric Test
1)Single Population mean
H0="The mean lifetime of a light bulb is more than 10000 hours i.e mu>10000"
H1="The mean lifetime of a light bulb is not more than 10000 hours i.e. mu<=10000"
xbar=9900
mu=10000
sd=120
n=30
los=0.05

tcal=(xbar-mu)/(sd/sqrt(n))
print("T Calculated Value")
print(tcal)
ttab=qnorm(1-los)
print(ttab)
if(tcal<0)
tcal= tcal * (-1)
if(tcal<ttab){
print("Accept the null hypothesis")
print(H0)
}else{
print("Reject the null hypothesis")
print(H1)
}
2) Left tailed Test
H0="The average IQ of students is atleast 110 i.e mu>=110"
H1="The average IQ of students is less than 110 i.e mu<110"
xbar=108
mu=110
sd=10
n=20
los=0.01

tcal=(xbar-mu)/(sd/sqrt(n))
print("T Calculated Value")
print(tcal)
ttab=qnorm(1-los)
print(ttab)
if(tcal<0)
tcal= tcal * (-1)
if(tcal<ttab){
print("Accept the null hypothesis")
print(H0)
}else{
print("Reject the null hypothesis")
print(H1)
}

3) Right tailed Test


H0="The manufacturing cost of computer is not more than 1800 mu<=1800"
H1="The manufacturing cost of computer is more than 1800 i.e mu>1800"
xbar=1950
mu=1800
sd=500
n=40
los=0.05

tcal=(xbar-mu)/(sd/sqrt(n))
print("T Calculated Value")
print(tcal)
ttab=qnorm(1-los)
print(ttab)
if(tcal<0)
tcal= tcal * (-1)
if(tcal<ttab){
print("Accept the null hypothesis")
print(H0)
}else{
print("Reject the null hypothesis")
print(H1)
}

H0="The mean weight is 15.4"


H1="The mean weight is not 15.4"
xbar=14.6
mu=15.4
sd=2.5
n=35
los=0.05
los =los /2

tcal=(xbar-mu)/(sd/sqrt(n))
print("T Calculated Value")
print(tcal)
ttab=qnorm(1-los)
print(ttab)
if(tcal<0)
tcal= tcal * (-1)
if(tcal<ttab){
print("Accept the null hypothesis")
print(H0)
}else{
print("Reject the null hypothesis")
print(H1)
}
4) Two tailed Test
H0="Engine will continuosly run for 300 minutes"
H1="Engine will not continuosly run for 300 minutes"
xbar=295
mu=300
sd=20
n=50
los=0.05
los =los /2

tcal=(xbar-mu)/(sd/sqrt(n))
print("T Calculated Value")
print(tcal)
ttab=qnorm(1-los)
print(ttab)
if(tcal<0)
tcal= tcal * (-1)
if(tcal<ttab){
print("Accept the null hypothesis")
print(H0)
}else{
print("Reject the null hypothesis")
print(H1)
}

You might also like