COST Worksheet - Practical - 5

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

Computer Oriented Statistical Techniques

Practical #5
Name Mohammad Hasan Javed Shaikh Roll No. 21302C0035
Class SYBSc.IT Division : C
Practical 4 Import the data from excel/csv file & Calculate S.D, Variance

Q1. Import the data from Excel/.CSV file and find the mean and Median of Age and Income
variables.
Dataset link - CardioGoodFitness.csv
 
Dataset link - CardioGoodFitness.csv 

1) Mean of Age :

2) Mean of Income :

3) Median of Age :

Vidyalankar School of Information Technology


4) Median of Income :

5) Sum of Miles :

Q2.Using the same dataset calculate S.D & Variance of Age, Income and Education.
Standard Deviation of Age :

Variance of Age :

Standard Deviation of Income :

Variance of Income :

Standard Deviation of Education :

Variance of Education :

Vidyalankar School of Information Technology


Q3. Define correlation and covariance of variable.
Calculate covariance & correlation between the Age and Income , Age and Fitness
variables.
Correlation :
Correlation is a statistical measure that expresses the extent to which two variables are
linearly related (meaning they change together at a constant rate). It’s a common tool for
describing simple relationships without making a statement about cause and effect.

Covariance :
Covariance is a measure of the relationship between two random variables and to what extent, they change
together. Or we can say, in other words, it defines the changes between the two variables, such that change
in one variable is equal to change in another variable.

Correlation between age and Income :

Correlation between age and Fitness :

Covariance between age and Income :

Covariance between age and fitness :

Q.4 Define Skewness and Kurtosis.


Calculate Skewness and Kurtosis of Income and Education.
Skewness of Income :

Vidyalankar School of Information Technology


Skewness Of Eduction :

Kurtosis of Income :

Kurtosis of Eduction :

a=read.csv("C:/Users/admin/Downloads/CardioGoodFitness.csv")
print(a)
b=mean(a$Age) #Mean of age

Vidyalankar School of Information Technology


print(b)
c=median(a$Age) #Median of median
print(c)
d=mean(a$Income) #Mean of Income
print(d)
e=median(a$Income) #Median of Income
print(e)
f=sum(a$Miles) #Sum of Miles
print(f)
g=sd(a$Age) #Standard Deviation of Age
print(g)
h=sd(a$Income) #Standard Deviation of Income
print(h)
i=sd(a$Education) #Standard Deviation of Education
print(i)
j=var(a$Age) #Variance of age
print(j)
k=var(a$Income) #Variance of Income
print(k)
l=var(a$Education) #Variance of Education
print(l)
m=cor(a$Age,a$Income) #Correlation between Age and Income
print(m)
n=cor(a$Age,a$Fitness) #Correlation between Age and Fitness
print(n)
o=cov(a$Age,a$Income) #Covariance between Age and Income
print(o)
p=cov(a$Age,a$Fitness) #Covariance between Age and Fitness
print(p)

library(moments)

q=skewness(a$Income) #Skewness Of Income :


print(q)
r=skewness(a$Education) #Skewness Of Eduction :
print(r)

s=kurtosis(a$Income) #Kurtosis of Income :


print(s)
t=kurtosis(a$Education) #Kurtosis of Eduction :
print(t)

Vidyalankar School of Information Technology

You might also like