Assignment
Assignment
Q2) Identify the Data types, which were among the following
Nominal, Ordinal, Interval, Ratio.
Data Data Type
Gender Nominal
High School Class Ranking Nominal
Celsius Temperature Interval
Weight Ratio
Hair Color Ratio
Socioeconomic Status Interval
Fahrenheit Temperature Ratio
Height Ratio
Type of living accommodation Ordinal
Level of Agreement Interval
IQ(Intelligence Scale) Interval
Sales Figures Interval
Blood Group Ratio
Time Of Day Interval
Time on a Clock with Hands Interval
Number of Children Ratio
Religious Preference Nominal
Barometer Pressure Interval
SAT Scores Interval
Years of Education Interval
Q3) Three Coins are tossed, find the probability that two heads and one tail are
obtained?
Answer:
Total number of events is = 8 (HHH/TTT/HTH/THH/HHT/TTH/HTT/THT)
No. of interested events for 2 heads and 1 tail is = 3 (HTH/THH/HHT)
Probability = No. of interested events/Total no of events
Probability = 3/8 (0.375)
Q4) Two Dice are rolled, find the probability that sum is
a) Equal to 1
b) Less than or equal to 4
c) Sum is divisible by 2 and 3
Answers:
S={(1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) (3,1)
(3,2) (3,3) (3,4) (3,5) (3,6) (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) (5,1) (5,2) (5,3)
(5,4) (5,5) (5,6) (6,1) (6,2) (6,3) (6,4) (6,5) (6,6)}
Divisible by 2 are 2,4,6,8,10 and 12 {(1,1) (1,3) (1,5) (2,2) (2,4) (2,6) (3,1)
(3,3) (3,5) (4,2) (4,4) (4,6) (5,1) (5,3) (5,5) (6,2) (6,4) (6,6)}
Probability = No. of interested events/Total no of events
Probability = 18/36=1/2 (0.5)
Divisible by 3 are 3,6,9 and 12 {(1,2) (1,5) (2,1) (2,4) (3,3) (3,6) (4,2) (4,5)
(5,1) (5,4) (6,3) (6,6)}
Probability = No. of interested events/Total no of events
Probability = 12/36=1/3 (0.333)
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?
Answer:
Total number of balls are (2+3+2=7)
Total of ways that the balls can be picked out of 7 balls are 2 randomly [N(s)]
ncr = n!/(n-r)!(r)!
7c2 = (7*6)/2 = 21
N(s) = 21
Answers:
> # Q7.csv file import
> library(readr)
> Q7 <- read_csv("C:/Users/Anupama Raghavendra/Desktop/ExcelR/ASSIGNMENTS/2.
Basic statistics Level 1/Q7.csv")
Parsed with column specification:
cols(
X1 = col_character(),
Points = col_double(),
Score = col_double(),
Weigh = col_double()
)
Warning message:
Missing column names filled in: 'X1' [1]
> View (Q7)
> #Mean of Points field
> meanofPoints<-mean(Q7$Points)
> print(meanofPoints)
[1] 3.596563
> #Mean of Score field
> meanofscore<-mean(Q7$Score)
> print(meanofscore)
[1] 3.21725
> #Mean of weigh field
> meanofWeigh<-mean(Q7$Weigh)
> print(meanofWeigh)
[1] 17.84875
> #median of Points field
> medianofPoints<-median(Q7$Points)
> print(medianofPoints)
[1] 3.695
> #median of Score field
> medianofScore<-median(Q7$Score)
> print(medianofScore)
[1] 3.325
> #median of Weigh field
> medianofWeigh<-median(Q7$Weigh)
> print(medianofWeigh)
[1] 17.71
> # mode of points field
> #mode(Q7$Points)
> # mode of score field
> # mode of weigh field
> varianceofPoints<-var(Q7$Points)
> print(varianceofPoints)
[1] 0.2858814
>
> varianceofScore<-var(Q7$Score)
> print(varianceofScore)
[1] 0.957379
>
> varianceofWeigh<-var(Q7$Weigh)
> print(varianceofWeigh)
[1] 3.193166
>
> Standareddeviationofpoints<-sd(Q7$Points)
> print(Standareddeviationofpoints)
[1] 0.5346787
>
> StandareddeviationofScore<-sd(Q7$Score)
> print(StandareddeviationofScore)
[1] 0.9784574
>
> StandareddeviationofWeigh<-sd(Q7$Weigh)
> print(StandareddeviationofWeigh)
[1] 1.786943
>
> range(Q7$Points)
[1] 2.76 4.93
> range(Q7$Score)
[1] 1.513 5.424
> range(Q7$Weigh)
[1] 14.5 22.9
>
Q9) Calculate Skewness, Kurtosis & draw inferences on the following data
Cars speed and distance
SP and Weight(WT)
Q10) Draw inferences about the following boxplot & histogram
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.
2) What can we say about the student marks?
Q13) What is the nature of skewness when mean, median of data are equal?
Q14) What is the nature of skewness when mean > median ?
Q15) What is the nature of skewness when median > mean?
Q16) What does positive kurtosis value indicates for a data ?
Q17) What does negative kurtosis value indicates for a data?
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
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