Professional Documents
Culture Documents
Hypothesis Testing Parametric Test: NAME:-Raunak Malkani DATE: - 13/01/2022 UID: - 20BIT032 1) Single Population Mean
Hypothesis Testing Parametric Test: NAME:-Raunak Malkani DATE: - 13/01/2022 UID: - 20BIT032 1) Single Population Mean
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)
}
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)
}
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)
}