The document presents statistical analyses performed on various datasets, including age distributions of students, faculty responses, height frequencies, mosquito body lengths, and sugar dispensing weights. Key measures of central tendency (mean, median, mode) and dispersion (range, variance, standard deviation) are calculated, along with skewness and kurtosis for quality control data. R code is provided for each analysis, demonstrating the application of statistical formulas and methods.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views10 pages
KM K 111111111111111
The document presents statistical analyses performed on various datasets, including age distributions of students, faculty responses, height frequencies, mosquito body lengths, and sugar dispensing weights. Key measures of central tendency (mean, median, mode) and dispersion (range, variance, standard deviation) are calculated, along with skewness and kurtosis for quality control data. R code is provided for each analysis, demonstrating the application of statistical formulas and methods.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10
Experiment 1
Descriptive Statistics (Measure of central
tendency, Measure of dispersion, Measure of Skewness and Measure of kurtosis) Course: BMAT202P Semester: Winter Semester 2024-25 Slot: L33+L34 Name: Kotra ManojKumar Registration Number: 23BCE2113 Problem-1: Twenty students , graduates and undergraduates, were enrolled in a statistics course. Their ages were: 18,19,19,19,19,20,20,20,20,20,21,21,21,21,22,23,24,27,30,36 a) Find Mean and Median of all students b) Find median age of all students under 25 years. c) Find modal age of all students Formula: 𝑚ⅇ𝑎𝑛 = 𝛴𝑥/n R Code: > x=c(18,19,19,19,19,20,20,20,20,20,21,21,21,21,22,23,24,27,30,36) > mean(x) [1] 22 > median(x) [1] 20.5 > y=x[x<25] > md=median(y) > md [1] 20 > xr=table(x) > mode=which(xr==max(xr)) > mode 20 3 a) Mean = 22, Median = 20.5 b) Median age of students under 25 years = 20 c) Mode = 20 Measures of central tendency for frequency table: - Problem-2: A survey of 25 faculty members is taken in a college to study their vocational mobility. They were asked the question “In addition to your present position, at how many educational institutes have served on the faculty? Following is the frequency distribution of their responses. X0123 f 8 11 5 1 Find mean and median of the distribution. R Code: > x=c(0,1,2,3) > f=c(8,11,5,1) > y=rep(x,f) > mean=(sum(y))/(length(y)) > mean [1] 0.96 > median(y) [1] 1 Mean = 0.96 Median = 1 Problem-3: Compute mean, median and mode of for the following frequency Distribution: Height (in cms) 145- 150 150- 155 155- 160 160- 165 165- 170 170- 175 175- 180 180- 185 No. of Adult men 4 6 28 58 64 30 5 5 Formulae: 𝑚ⅇ𝑎𝑛 = (∑𝑥𝑖𝑓𝑖) / (𝛴𝑓𝑖) 𝑚ⅇ𝑑ⅈ𝑎𝑛 = 𝑙 + (ℎ/𝑓) [ (𝑁/2) − 𝑐] modⅇ = 𝑙 + [ℎ(𝑓1 − 𝑓0 )/(𝑓1 − 𝑓0 ) − (𝑓2 − 𝑓1 )] R Code: > mid=seq(147.5,182.5,5) > mid [1] 147.5 152.5 157.5 162.5 167.5 172.5 177.5 182.5 > f=c(4,6,28,58,64,30,5,5) > fr.distr=data.frame(mid,f) > fr.distr mid f 1 147.5 4 2 152.5 6 3 157.5 28 4 162.5 58 5 167.5 64 6 172.5 30 7 177.5 5 8 182.5 5 > mean=(sum(mid*f))/sum(f) > mean [1] 165.175 > midx=seq(147.5,182.5,5) > frequency=c(4,6,28,58,64,30,5,5) > fr.dist<-data.frame(midx,frequency) > fr.dist midx frequency 1 147.5 4 2 152.5 6 3 157.5 28 4 162.5 58 5 167.5 64 6 172.5 30 7 177.5 5 8 182.5 5 > cl=cumsum(frequency) > cl [1] 4 10 38 96 160 190 195 200 > n=sum(frequency) >n [1] 200 > ml=min(which(cl>=n/2)) > ml [1] 5 > h=5 >h [1] 5 > f=frequency[ml] >f [1] 64 > c=cl[ml-1] >c [1] 96 > l=mid[ml]-h/2 >l [1] 165 > median=l+(((n/2)-c)/f)*h > median [1] 165.3125 > m=which(frequency==max(frequency)) #serial number of the median class >m [1] 5 > fm=frequency[m] > fm [1] 64 > f1=frequency[m-1] > f2=frequency[m+1] > f1 [1] 58 > f2 [1] 30 > l=midx[m]-h/2 >l [1] 165 > mode=l+((fm-f1)/(2*fm-f1-f2))*h > mode [1] 165.75 Mean: 165.175 Median: 165.3125 Mode: 165.75 Measure of dispersion: - Problem-4: An entomologist studying morphological variation in species of mosquito recorded the following data on body length: 1.2,1.4,1.3,1.6,1.0,1.5,1.7,1.1,1.2,1.3 Compute all the measures of dispersion. Formulae: Range=Largest Value – Smallest Value Q.D=(Q3-Q1)/2 M.D=(∑|x-A|)/n , where |x-A| is an absolute deviation taken from A Direct Formula: Sigma=sqrt(∑[x-x’)^2]/n) , where x’=∑x/n = A.M R CODE: > x=c(1.2,1.4,1.3,1.6,1.0,1.5,1.7,1.1,1.2,1.3) >x [1] 1.2 1.4 1.3 1.6 1.0 1.5 1.7 1.1 1.2 1.3 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 1.000 1.200 1.300 1.330 1.475 1.700 > range=1.7-1.0 > range [1] 0.7 > var(x) [1] 0.049 > sd=sqrt(var(x)) > sd [1] 0.2213594 > cqd=(1.475-1.2)/(1.475+1.2) > y=(x-mean(x)) >y [1] -0.13 0.07 -0.03 0.27 -0.33 0.17 0.37 -0.23 -0.13 -0.03 > y=abs(y) >y [1] 0.13 0.07 0.03 0.27 0.33 0.17 0.37 0.23 0.13 0.03 > mdl=sum(y)/length(y) > mdl [1] 0.176 > z =abs(x-median(x)) > md2=sum(z)/length(z) > md2 [1] 0.17 Range = 0.7 Quartile Deviation = 0.1375 Mean Deviation About Mean = 0.176 Mean Deviation About Median = 0.17 Mean Deviation About Mode = Not Possible as Bi-Modal Standard Deviation = 0.2213594 Measure of skewness and kurtosis using Moments: Problem-5: A quality control engineer is interested in determining whether a machine is properly adjusted to dispense 16 ounces of sugar. Following data refer to the net weight(in ounces) packed in thirty one-pound bags after the machine was adjusted. Compute the measures skewness and kurtosis: 15.9,16.2,16.0,15.6,16.2,15.9,16.0,15.6,15.6,16.0,16.2,15.6,15.9,16.2,15.6, 16.2, 15.8,16.0,15.8,15.9,16.2,15.8,15.8,16.2,16.0,15.9,16.2,16.2,16.0,15.6 Formulae: R Code: >x=c(15.9,16.2,16.0,15.6,16.2,15.9,16.0,15.6,15.6,16.0,16.2,15.6,15.9,16.2,15. 6,16.2,15.8,16.0,15. 8,15.9,16.2,15.8,15.8,16.2,16.0,15.9,16.2,16.2,16.0,15.6) >x [1] 15.9 16.2 16.0 15.6 16.2 15.9 16.0 15.6 15.6 16.0 16.2 15.6 15.9 16.2 15.6 16.2 [17] 15.8 16.0 15.8 15.9 16.2 15.8 15.8 16.2 16.0 15.9 16.2 16.2 16.0 15.6 > n=length(x) >n [1] 30 > mean=mean(x) > mean [1] 15.93667 > m4=sum((x-mean)^4)/n > m4 [1] 0.004062022 > m2=var(x) > m2 [1] 0.0486092 > beta2=m4/(m2^2) > beta2 [1] 1.719117 > gam2=beta2-3 > gam2 [1] -1.280883 µ1 = 15.93667 µ2 = 0.0486092 µ3 = -0.002451407, µ4 = 0.004062022 β1 = 0.05232096 γ1 = 0.2287378 (Positively Skewed) β2 = 1.719117 γ2 = -1.280883 (Platykurtic Curve)