Stats Final Record
Stats Final Record
S
REG NO:2413711034070
Question :
1. Find range & standard deviation for the following data.
10 20 40 70 80 40 90
Coding:
t=c(10,20,40,70,80,40,90)
range(t)
sd(t)
Result:
>t=c(10,20,40,70,80,
40,90)
>range(t
)
[1] 1090
>sd(t)
[1] 30.5505
NAME: YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG NO:2412711034070
QUARTILE DEVIATION
Question:
Calculate the quartile deviation for the following data: 12, 15, 20, 28, 30, 40, 50
Coding:
#Name: YASHI.S#
#REG NO.:2413711034070#
x=c(12,15,20,28,30,40,50)
q1=quantile(x,0.75) q1
q2=quantile(x,0.25) q2 qd=(q1-q2)/2
qd
Result:
The quartile deviation for the given data is 8.75.
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG NO:2413711034070
COEFFICIENT OF VARIATION
Question :
7. The scores of 2 batsmen A & B in ten innings during a certain season are as follows.
A 10 115 5 73 7 120 36 84 29 19
B 45 12 76 42 4 50 37 48 13 0
Coding:
a=c(10,115,5,73,7,120,36,84,29,19)
cv1=((sd(a)/mean(a))*100)
cv1
b=c(45,12,76,42,4,50,37,48,13,0)
cv2=((sd(b)/mean(b))*100)
cv2
Result:
>a=c(10,115,5,73,7,120,36,84,
29,19)
>cv1=((sd(a)/mean
(a))*100)
> 1
cv
[1] 89.50609
>b=c(45,12,76,42,4,50,37,48,13,
0)
>cv2=((sd(b)/mean
(b))*100)
> 2
cv
[1] 74.72809
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG NO:2413711034070
COEFFICIENT OF CORRELATION
Question :
2. Calculate the coefficient of correlation of the following data.
x 1 1 1 1 1 2 2 24 26 28
2 3 3 5 5 7 8
Coding: 0 0 7 0 6 8 9
#Name: YASHI.S#
#REG NO.:2413711034070#
x=c(10,12,14,16,18,20,22,24,26,28)
y=c(20,30,37,50,56,78,89,100,120,1
10) cor(x,y,method="pearson"
)
Result:
The coefficient of correlation for the given data is 0.9851764
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG NO:2413711034070
RANK CORRELATION
Question :
1. Calculate the Rank correlation coefficient of the following data.
x 3 5 1 6 7 2 8 9 4
y 5 3 2 6 8 1 7 9 4
Coding:
#Name: YASHI.S #
#REG NO:2413711034070#
x=c(3,5,1,6,7,2,8,9,4)
y=c(5,3,2,6,8,1,7,9,4)
cor(x,y,method="spearman")
Result:
The Rank Correlation coefficient for the given data is 0.9
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG NO:2413711034070
REGRESSION EQUATION
Question :
3. Find the regression equation for the following data.
x 1 2 3 4 5 8 1
y 9 8 10 12 14 16 0
1
Coding: 5
#Name: YASHI.S#
#REG NO.:2413711034070#
x=c(1,2,3,4,5,8,10)
y=c(9,8,10,12,14,16,15)
r1=lm(x~y) print(r1) r2=lm(y~x)
print(r2)
Result:
The Regression equation of x on y is X = 0.9483 Y - 6.6650
The Regression equation of y on x is Y = 0.8671 X + 7.9122
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.
REG
S
NO:2413711034070
Question
A
: sample of 10 house owners is drawn. Their incomes are obtained as values. Mean is
standard deviation is ₨650. Test the hypothesis that the average income of the house
₨6000,
town is of the
owners
₨5500.
Coding
:#Name:
YASHI.S#
#REG
NO.:2413711034070#
xbar=60
00
sd=65
0
muo=550
0
n=1
0
t=(xbar-muo)/(sd/sqrt(n-
1))
t
alpha=0.
05
t.half.alpha=qt(1-alpha/
2,df=n-1)
t.half.alph
a
Result:
H0:
µ=5500
H1: µ≠5500 (2-tailed
test)
Test statistic: t =
(xbar-µ)/(s/sqrt(n-1))
Calculated value =
2.307692
Tabulated value =
2.262157
Conclusion:-
Since calculated value is greater than tabulated value, we reject H0 and
accept H1.
Therefore the population mean of house owners in town is not equal
to 5500.
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.
REG
S
NO:2413711034070
Conclusion:-
Since calculated value is lesser than tabulated value, we accept H0 and
reject H1. on an average height of sailors is equal to that of the
Therefore
soldiers.
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG
NO:2413711034070
PAIRED t-TEST
Question:
An IQ test was given to 10 men, before and after training. Test whether there is any
change
after theintraining
IQ program at 1% level of
significance.
Me 2 3 4 5 6 7 8 9 1
1
n 0
IQ(before 167 1 1 1 1 1 1 1 1 1
) 2 5 5 6 5 5 6 3 4
IQ(after 170 4 7 5 3 4 6 8 3 3
)
1 1 1 1 1 1 1 1 1
3 5 5 5 6 6 7 4 3
8 8 6 6 7 8 2 2 8
Coding:
#Name:YASHI.S
#
#REGNO.:2413711034070
#
x=c(167,124,157,155,163,154,156,168,133,14
3)
y=c(170,138,158,156,156,167,168,172,142,13
8)
d=x-
y
d
dbar=mean(
d)
dba
r
sigma=sd(
d)
sigm
a
n=1
0
t=dbar/(sigma/sqrt(n-
1))
t
alpha=0.0
1
t.half.alpha=qt(1-alpha/2,df=n-
1)
t.half.alph
a
NAME:YASHI.S
REG NO:2413711034070
Result:
H0: µ=0
H1: µ≠0 (2-tailed test)
Test statistic: t = dbar/(sigma*sqrt(n-1))
Calculated value = |-1.83241| that is 1.83241
Tabulated value = 3.249836
Conclusion:-
Since calculated value is lesser than tabulated value, we accept H0 and reject H1.
Therefore there is no change in IQ after the training program.
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.
REG
S
NO:2413711034070
Question
:A sample of 450 items is taken from a population; whose standard deviation is 20, mean
is 30. Test
whether the sample has come from a population with
mean 29.
Coding
:#Name:
YASHI.S#
#REG
NO.:2413711034070#
xbar=3
0
sigma=2
0
muo=2
9
n=45
0
z=(xbar-muo)/(sigma/
sqrt(n))
z
alpha=0.0
5
z.half.alpha=qnorm(1-
alpha/2)
z.half.alph
a
Result:
H0:
µ=29
H1: µ≠29 (2-tailed
test)
Test statistic: Z =
(xbar-µ)/(sigma*sqrt(n))
Calculated value =
1.06066
Tabulated value =
1.959964
Conclusion:-
Since calculated value is lesser than tabulated value, we accept H0 and
reject H1.
Therefore the sample is taken from a population with
mean 29
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG
NO:2413711034070
Question:
Random samples drawn from 2 places gave the following data. Relating to the heights of
adult
males
.
Place Place
Mean A
68. B
68.5
S.D of
heights(inches) 2.
5 3.
8
Sample
heights 120
5 150
0
Size 0 0
Coding:
#Name:
YASHI.S#
#REG
NO.:2413711034070#
n1=120
0
s1=2.
5
x1bar=68.
5
n2=150
0s2=3.
0
x2bar=68.5
8z=(x1bar-x2bar)/sqrt((s1*s1)/n1+(s2*s2)/
zn2)
alpha=0.0
5
z.half.alpha=qnorm(1-
alpha/2)
z.half.alph
a
Result:
H0:
µ1=µ2
H1: µ1≠µ2 (2-
tailed)
Test statistic: Z =
(x1bar-x2bar)/sqrt((s1*s1/n1)+(s2*s2/n2))
Calculated value = |-0.7556479| that is
0.7556479
Tabulated value =
1.959964
NAME:YASHI.S
REG NO:2413711034070
Conclusion:-
Since the calculated value is lesser than the tabulated value, we accept H0
and reject H1.
Therefore the mean height of the adults is the same in both places.
NAME:YASHI.S
REG NO:2413711034070
Output:
NAME:YASHI.S
REG NO:2413711034070
CHI-SQUARE TEST
Question:
The following data is collected on two characteristics. Based on this can you say there is
no
relationship between the habit of smoking and
literacy.
Smoker Non-Smokers
s
Literat 83 57
e
Illiterate 45 68
Coding:
#Name: YASHI.S#
#REG NO.:2413711034070#
print(getwd()
)
setwd("D:"
)
data=read.csv("CHISQR.CSV"
)
dat
a
chisq.test(data
)
Result:
H0: There is no relationship between the habit of smoking and
literacy.
H1: There is relationship between the habit of smoking and
literacy.
Calculated value =
0.003159
Tabulated value =
0.05
Conclusion:-
Since the calculated value is lesser than the tabulated value, we reject H0 and accept
H1.
Therefore there is a relationship between the habit of smoking and
literacy.
NAME:YASHI.S
REG NO:2413711034070
Output: