Prof. Indranil Dutta
School of Languages and
Linguistics
Jadavpur University
## Sl..No. crime_head Arrested_Male
## 1 1 Murder 4907
## 2 2 Culpable Homicide not amounting to Murder 385
## 3 3 Causing Death by Negligence 6261
## 4 3.1 Deaths due to Negligence relating to Road Accidents 5177
## 5 3.1.1 Hit and Run 1880
## 6 3.1.2 Other Accidents 3297
## Arrested_Female Arrested_Transgender Arrested_Total Chargesheeted_Male
## 1 178 2 5087 3950
## 2 12 0 397 333
## 3 160 0 6421 6202
## 4 150 0 5327 5208
## 5 43 0 1923 1875
## 6 107 0 3404 3333
## Chargesheeted._Female Chargesheeted_Transgender Chargesheeted_Total
## 1 141 2 4093
## 2 9 0 342
## 3 154 0 6356
## 4 143 0 5351
## 5 37 0 1912
## 6 106 0 3439
## Convicted_Male Convicted_Female Convicted_Transgender Convicted_Total
## 1 446 20 0 466
## 2 44 0 0 44
## 3 1118 47 0 1165
## 4 772 46 0 818
## 5 338 22 0 360
## 6 434 24 0 458
## Discharged_Male Discharged_Female Discharged_Transgender Discharged_Total
## 1 16 0 0 16
## 2 4 0 0 4
## 3 61 0 0 61
## 4 58 0 0 58
## 5 6 0 0 6
## 6 52 0 0 52
## Acquitted_Male Acquitted_Female Acquitted_Transgender Acquitted_Total
## 1 592 29 0 621
## 2 53 0 0 53
## 3 1184 14 0 1198
## 4 734 11 0 745
## 5 264 6 0 270
## 6 470 5 0 475
male_data=ncrb$Arrested_Male
female_data=ncrb$Arrested_Female
plot(male_data,female_data, main="Male Female data of arrests", xlab="Total number of males arrested", ylab="Total number of females arrested")x = round(rnorm(36,4.5,2))
x = rnorm(36, 4.5, 2)#notice that this is different from round(rnorm(36,4.5,2)) where we had asked for rounded/integer values
x## [1] 4.04586014 4.38159300 3.82399352 0.39672292 5.54689333 4.10067467
## [7] 5.41834930 4.63787503 3.49470473 5.26120287 7.28048118 3.65898937
## [13] 5.80899707 5.86495062 1.64628987 3.71969255 4.00454054 5.99906269
## [19] 6.30300031 2.16548280 6.65337178 5.23121171 4.11077328 7.14945722
## [25] 3.10398847 4.52115090 6.39688798 5.81747550 7.20851970 6.26455324
## [31] -0.09690014 6.15190801 6.12879334 3.67732989 5.00083944 2.37631433
#Lets look at another example
x = rnorm(10000, 4.5, 2)
hist(x,breaks=100,freq=FALSE,xlim = c(0,10))
plot(function(x)dnorm(x, mean=4.5, sd=2), 0,10, add=TRUE)Why the excellent fit between the “observed” and the theoretical distributions?
The data is generated by random selection (rnorm()) of observations from the theoretical normal distribution (dnorm())
The “normal distribution” is an very useful theoretical function because…
If so, then we can think that - the “true” value of the underlying property we want to measure –
hist(x,breaks=1000,freq=FALSE,xlim = c(0,10))
plot(function(x)dnorm(x, mean=4.5, sd=2), 0,10, add=TRUE)plot(function(x)df(x, 5, 100),0,4, main="Measures of central tendency")
lines(x=c(0.6,0.6),y=c(0,df(0.6,5,100)))
skew.data <-rf(10000,5,100)
lines(
x=c(mean(skew.data),mean(skew.data)),
y=c(0,df(mean(skew.data),5,100)))
lines(
x=c(median(skew.data),median(skew.data)),
y=c(0,df(median(skew.data),5,100))
)
text(1,0.75,labels="mode")
text(1.3,0.67,labels="median")
text(1.35,0.6,labels="mean")Means represent the least squared estimate of the central tendency
In a jury system, if each juror was asked about their confidence in rating culpability by a weight, w\(_i\)
This way those ratings with a higher weight would give a better estimate of the central tendency
The weights represent the confidence each rater has on her particular rating
Mean \(\overline{x}\)=\(\frac{\sum_{i=0}^{n}x_i}{n}\)
Weighted mean \(\overline{x}\)=\(\frac{\sum_{i=0}^{n}w_ix_i}{\sum_{i=0}^{n}w_i}\)
Sum of squared deviations \(d^{2}\)=\(\sum_{i=0}^{n}\)\((x_i-\overline{x})^2\)
Variance
Notice that sample variance, \(s^2\) is calculated by dividing the sum of the squared deviations by n-1 and not n
Mean \(\overline{x}\)=\(\frac{\sum_{i=0}^{n}x_i}{n}\)
Population variance \(\sigma^2\)=\(\frac{\sum(x_i-\mu)^2}{N}\)
Sample variance \(s^2\)=\(\frac{\sum(x_i-\overline{x})^2}{n-1}\)
Population standard deviation =\(\sqrt\sigma^2\)
Sample standard deviation s=\(\sqrt s^2\)
\(z_i\)=\(\frac{x_i-\overline{x}}{s}\)
The area under the normal distribution curve is 1, therefore we can talk about the probability of finding a value larger than any value of x, smaller than any value of x, or between any two values of x; In other words, we can relate individual scores to the normal distribution
If we assume that our data are normally distributed, then we can approximate our data with a normal distribution - we can state these probabilities for our data given the mean and standard deviation
\(z_i\)=\(\frac{x_i-\overline{x}}{s}\)
# create sample data
sample_Data = rnorm(500)
# calculate CDF
CDF <- ecdf(sample_Data )
# draw the cdf plot
plot(CDF)t.test(ncrb$Chargesheeted_Male, ncrb$Chargesheeted._Female, alternative = "two.sided", var.equal = FALSE)##
## Welch Two Sample t-test
##
## data: ncrb$Chargesheeted_Male and ncrb$Chargesheeted._Female
## t = 2.8866, df = 59.618, p-value = 0.005416
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 1077.059 5940.807
## sample estimates:
## mean of x mean of y
## 3741.3167 232.3833