Basic Statistics 1
Basic Statistics 1
Basic Statistics 1
Q2) Identify the Data types, which were among the following
Nominal, Ordinal, Interval, Ratio.
Data Data Type
Gender Nominal
High School Class Ranking Ordinal
Celsius Temperature Ratio
Weight Ratio
Hair Color Ordinal
Socioeconomic Status Ratio
Fahrenheit Temperature Ratio
Height Ratio
Type of living accommodation Ordinal
Level of Agreement Nominal
IQ(Intelligence Scale) Interval
Sales Figures Ratio
Blood Group Nominal
Time Of Day Ratio
Time on a Clock with Hands Ratio
Number of Children Interval
Religious Preference Nominal
Barometer Pressure Ratio
SAT Scores Ratio
Years of Education Interval
Q3) Three Coins are tossed, find the probability that two heads and one tail are
obtained?
{HHH, HHT, HTH, THH, TTT, TTH, THT, HTT}
P (2Heads & 1 Tail)=3/8=0.375
Q4) Two Dice are rolled, find the probability that sum is
a) Equal to 1= 0
b) Less than or equal to 4 = 6/36= 1/6
c) Sum is divisible by 2 and 3 = 6/36= 1/6
Q5) A bag contains 2 red, 3 green and 2 blue balls. Two balls are drawn at
random. What is the probability that none of the balls drawn is blue?
From all 3 columns, they are slightly left skewed or positively skewed data, its also
normal distributed data.
Only few outliers 2 in Wt col and 1 in qsec.
Q9) Calculate Skewness, Kurtosis & draw inferences on the following data
Cars speed and distance
Skewness
{E((X-µ)/σ)^3}
Kutosis
For Speed {E(((X-µ)/σ)^4) -3}
For Dist
SP and Weight(WT)
Skewness
{E((X-µ)/σ)^3}
Kutosis
{E(((X-µ)/σ)^4) -3}
This is positively Skewed data, positive kurtosis and has many outliers
Q11) Suppose we want to estimate the average weight of an adult male in
Mexico. We draw a random sample of 2,000 men from a population of
3,000,000 men and weigh them. We find that the average person in our
sample weighs 200 pounds, and the standard deviation of the sample is 30
pounds. Calculate 94%,98%,96% confidence interval ?
Q12) Below are the scores obtained by a student in tests
34,36,36,38,38,39,39,40,40,41,41,41,41,42,42,45,49,56
1) Find mean, median, variance, standard deviation.
> stud<-c(34,36,36,38,38,39,39,40,40,41,41,41,41,42,42,45,49,56)
> length(stud)
[1] 18
> mean(stud)
[1] 41
> median(stud)
[1] 40.5
> var(stud)
[1] 25.52941
> sd(stud)
[1] 5.052664
Q13) What is the nature of skewness when mean, median of data are equal?
It’s a normal Distribution
Q14) What is the nature of skewness when mean > median ?
It’s a positively skewed data
Q15) What is the nature of skewness when median > mean?
It’s a negatively Skewed data
Q16) What does positive kurtosis value indicates for a data ?
It means there is has a peak value
Q17) What does negative kurtosis value indicates for a data?
The data is spread across similarly.
Q18) Answer the below questions using the below boxplot visualization.
Draw an Inference from the distribution of data for Boxplot 1 with respect
Boxplot 2.
Q 20) Calculate probability from the given dataset for the below cases
Data _set: Cars.csv
Calculate the probability of MPG of Cars for the below cases.
MPG <- Cars$MPG
a. P(MPG>38)
b. P(MPG<40)
c. P (20<MPG<50)
First found mean and Standard deviation, then calculated:
m<-mean(car1$MPG) 34.42208
s<-sd(car1$MPG) 9.131445
a. > 1-pnorm(38,m,s)
[1] 0.3475939 => 34.76%
b. > pnorm(40,m,s)
[1] 0.7293499 => 72.93%
c. > z2<-pnorm(50,m,s) => 0.9559927
> z1<-pnorm(20,m,s) => 0.05712378
> z2-z1 => 0.8988689 =>89.89%
import pandas as pd
import numpy as np
cd=pd.read_csv("C:\\Users\\DS0029tu
\\Desktop\\Data Science\\CSV & EXL
files\\Cars.csv")
import pylab
import scipy.stats as st
st.probplot(cd['MPG'],dist="norm",plot=pylab)
----------------------------
plt.hist(cd['MPG']) # for boxplot visualization
----------------------------
The MPG of cars does not follow normal
distribution, it is more of right skewed data.
b) Check Whether the Adipose Tissue (AT) and Waist Circumference(Waist)
from wc-at data set follows Normal Distribution
Dataset: wc-at.csv
QQ plot of Waist Circumference: QQ plot of AT:
Q 24) A Government company claims that an average light bulb lasts 270
days. A researcher randomly selects 18 bulbs for testing. The sampled bulbs
last an average of 260 days, with a standard deviation of 90 days. If the
CEO's claim were true, what is the probability that 18 randomly selected
bulbs would have an average life of no more than 260 days
Hint:
rcode pt(tscore,df)
df degrees of freedom
n=18; df=17
S=90
t=270-260/(90/sqrt18)=10/21.211=0.471
In python code:
import math
n=math.sqrt(18)
err=90/n
tscore=(270-260)/err
tscore
Out[10]: 0.4714045207910317,
Now check the value in Tscore table with the tscore value and degree of freedom, hence
approx. 50% confidence interval.