You are on page 1of 9

Digital Assignment No.

4
MAT 2001 – Statistics for Engineers
EMBEDDED LAB – Programming with R

Name: Varnit Goel


Reg. No: 20BCE0662

Submitted to: Mr. Venkataraman B


INPUT
# xbar=13.5 # sample mean
# u=14 #hypothesis value
# sd=3 #standard deviation
# n=60 #size

zsum.test(mean.x = 13.5,sigma.x = 3,n.x=60,mean.y


= NULL,sigma.y = NULL ,n.y = NULL,alternative =
"two.sided",mu=14,conf.level =0.95)

zsum.test(mean.x =13.5,sigma.x = 3,n.x=60,mean.y =


NULL,sigma.y = NULL ,n.y = NULL,alternative =
"two.sided",mu=14,conf.level =0.99)
OUTPUT WINDOW

RESULT :-
At α = 0.05, Zcal = -1.291, we know Zα = 1.96,
We see that |Zcal|< Zα, therefore we have no
evidence to reject Null Hypothesis.
The rejection region is: R – [12.74091, 14.25909]
Or everything excluding the confidence interval in
the output.

At α = 0.01, Zcal = -1.291, we know Zα = 2.58,


We see that |Z|< Zα, therefore we have no evidence
to reject Null Hypothesis.
The rejection region is: R – [12.50, 14.49]
Or everything excluding the confidence interval in
the output.

The P value = 0.1967 turns out to be greater


than 0.05 and
0.01, hence we cannot reject Null Hypothesis.
Hence, we accept the Null Hypothesis that “u =14
days”.

“The duration for treatment of disease by


medication has mean of 14 days ,𝑎 = 0.05 & 0.01
level of significance”.
INPUT
#company A
m=45 , xbar=63.5 ,s1=5.4
#company B
n=60 , ybar=66.2 ,s2=5.8

zsum.test(mean.x = 63.5,sigma.x=5.4,n.x=45,
mean.y = 66.2,sigma.y = 5.8 ,n.y=60,alternative
= "less",conf.level =0.95)

zsum.test(mean.x =63.5,sigma.x=5.4,n.x=45,mean.y
= 66.2,sigma.y = 5.8,n.y = 60,alternative =
"less",conf.level =0.90)
OUTPUT WINDOW

RESULT:-
Zcal = - 2.4559
| Zcal | > | Z α | (at 10 % & 5%)
Test Statistics is greater than 1.644 and 1.28,
therefore we reject Null Hypothesis
Hence, we accept the Alternate Hypothesis that
u1>u2
Or
Since the P value = 0.007027 which is less
than 0.05 and 0.1 Hence, we have solid
evidence to reject Null Hypothesis.

“Drying time of paints of company A is shorter


than of company B at 𝑎 = 0.05 & 0.10 level of
significance”.

INPUT
prop.test(c(100,55),c(190,65),alternative =
"two.sided",conf.level = 0.99)

prop.test(c(100,55),c(190,65),alternative =
"two.sided",conf.level = 0.90)
OUTPUT WINDOW
RESULT:-
At α = 0.01, the p-value is very small,
therefore we have evidence to reject null
hypothesis being correct is very small.
Hence, we accept alternate hypothesis.

At α = 0.10, the p-value is very small,


therefore we have evidence to reject null
hypothesis being correct is very small.
Hence, we accept alternate hypothesis.
Or
The P value is very small therefore we can
reject the Null Hypothesis and we can say that
“The cure rate is different between the two
drugs”.

P valueis smaller than 0.1(10%) and 0.01(1%)


therefore we accept the Alternate Hypothesis.

“The cure rate is different between the two


drugs A and B”.

You might also like