Sie sind auf Seite 1von 7

MAT2001

Statistics for Engineers

Embedded Lab–R
WINTER SEMESTER –2019∼2020
L57+L58 SLOT

E-RECORD

Submitted by

Name of the Student: SAIMA SHAHNAWAZ


Reg. No.: 19BCE0384
B.Tech. (Branch) – Ist year( CS
E)
Name of the School: SCOPE

DEPARTMENT OF
MATHEMATICS SCHOOL OF
ADVANCED SCIENCES VIT
UNIVERSITY
VELLORE – 632
014 TAMIL NADU
INDIA

Date: 12/03/2020
Experiment No. –v
Z–Test for Single Mean and Difference of Means
1. A sample of 900 items is found to have a mean of 3.47 cm. Write down the
R programming code to test whether it can be reasonably regarded as a
simple sample from a population with mean 3.23 cm and SD 2.31 cm at 99%
level of confidence.

AIM: Test for single mean

H0:muo=3.23

H1:muo!=3.23

INPUT:
> xbar=3.47
> mu0=3.23
> sigma=2.31
> n=900
> z=(xbar-mu0)/(sigma/sqrt(n))
> alpha=.01
> z.half.alpha=qnorm(1-alpha/2)
> c(z.h
llf.alp
ha) [1]
2.57582
9

OUTPUT:
> z
[1] 3.116883
CONCLUSION:
Here our value of Z is greater than zalpha, so H0 is rejected.

2.The average mark scored by 32 boys is 72 with a standard deviation of 8,


while that for 36 girls is 70 with a standard deviation of 6. Write down the R
programming code to test whether the boys are performing better than girls
on the basis of average mark at 5 % level of significance.

AIM: Test for difference of two means.

ASSUMPTIONS:
H0:mu1=mu0(performance of boys and girls is equal)
H1:mu1>mu0(boys perform better than girls)
INPUT:
> n1=32
> n2=36
> x1bar=72
> x2bar=70
> s1=8
> s2=6
> z=(x1bar-x2bar)/sqrt(s1^2/n1+s2^2/n2)
> zalpha=qnorm(1-alpha)
> zalpha

[1] 1.644854

OUTPUT:
> z
[1] 1.154701
CONCLUSION:
Here zalpha is greater than z, so our null hypothesis is accepted, that is Boys
do Perform better than girls.
:
OUTPUT:
Experiment No. –VI
AIM:-Z–Test for Single Proportion and Difference of Proportions

2. Experience has shown that 20% of a manufactured product is of top


quality. In one day’s production of 400 articles, only 50 are of top
quality. Write down the R programming code to test whether the
production of the day chosen is a representative sample at 95%
confidence level.

AIM:TEST FOR SINGLE PROPORTION.


ASSUMPTIONS:
> p=1/5
> P0=50/400
> alpha=.05
> zalpha=qnorm(1-alpha/2)
> zalpha
[1] 1.959964
> n=400
> z=(P0-p)/sqrt(p*(1-p)/n)
OUTPUT:
> z
[1] -3.75

CONCLUSION:
Here our zalpha is less than our value of z, so our null hypothesis is rejected.

OUTPUT:
3. Before an increase in excise duty on tea, 800 people out of
a sample of 1000 were consumers of tea. After the increase in
duty, 800 people were consumers of tea in a sample of 1200
persons. Write down the R programming code to test whether
the significant decrease in the consumption of tea after the
increase in duty at 1 % level of significance.
AIM:TEST FOR DIFFERENCE OF
PROPORTIONS. ASSUMPTIONS:
H0:p1=p2
H1:p1>p2(Single tailed test)
INPUT:
> n1=1000
> n2=1200
> p1=800/n1
> p2=800/n2
> P=(n1*p1+n2*p2)/(n1+n2)
> q=1-P
> z=(p1-p2)/(sqrt(P*q*(1/n1+1/n2)))
> zalpha=qnorm(1-alpha)
> zalpha
[1] 2.326348

OUTPUT:
> z(test
statistic
) [1]
6.992059

CONCLUSION:
Our zalpha at 1% significance level is 2.326, so our z>zalpha, i.e. z>2.326,so Our
NULL HYPOTHESIS IS REJECTED.
THERE IS A DIFFERENCE IN THE CONSUMPTION OF TEA BEFORE AND AFTER THE
INCREASE IN EXCISE DUTY.

OUTPUT:

Das könnte Ihnen auch gefallen