salil idc 2 (1)
salil idc 2 (1)
RESEARCH METHODOLOGIES:
SOFTWARE:- R SOFTWARE
DATA ANALYSIS
data=read.csv(file.choose())
head(data)
Series_reference Period Type DATAVALUE LOWERCI UPPERCI Units
1 W_A11 2000-02 Moving average 59 5092582 6840751 Injuries
2 W_A11 2001-03 Moving average 60 5123477 6876522 Injuries
3 W_A11 2002-04 Moving average 59 5030812 6769187 Injuries
4 W_A11 2003-05 Moving average 59 5030809 6769187 Injuries
5 W_A11 2004-06 Moving average 61 5247125 701954 Injuries
6 W_A11 2005-07 Moving average 63 5401831 7198168 Injuries
Indicator Cause Validation Population Age Severity
1 Number Assault Validated Whole pop All ages Fatal
2 Number Assault Validated Whole pop All ages Fatal
3 Number Assault Validated Whole pop All ages Fatal
4 Number Assault Validated Whole pop All ages Fatal
5 Number Assault Validated Whole pop All ages Fatal
6 Number Assault Validated Whole pop All ages Fatal
summary(data)
Series_reference Period Type DATAVALUE
Length:3094 Length:3094 Length:3094 Min. : 0.705
Class :character Class :character Class :character 1st Qu.: 6.358
Mode :character Mode :character Mode :character Median : 40.333
Mean : 382.674
3rd Qu.: 108.745
Max. :14058.000
NA's :2095
LOWERCI UPPERCI Units Indicator
Min. : 1 Min. : 1 Length:3094 Length:3094
1st Qu.: 6 1st Qu.: 7 Class :character Class :character
Median : 34 Median : 45 Mode :character Mode :character
Mean : 31321 Mean : 35592
3rd Qu.: 99 3rd Qu.: 130
Max. :5401831 Max. :7198168
NA's :2095 NA's :2095
Cause Validation Population Age
Length:3094 Length:3094 Length:3094 Length:3094
Class :character Class :character Class :character Class :character
Mode :character Mode :character Mode :character Mode :character
Severity
Length:3094
Class :character
Mode :character
x=c(59,60,65,56,61,63)
> m=mean(x)
> me=median(x)
> mode <- function(x) {
+ uniqx<- unique(x)
+ uniqx[which.max(tabulate(match(x, uniqx)))]}
> mo=mode(x)
> cat("The mean is",m,"\n")
The mean is 60.66667
> cat("The median is",me,"\n")
Measures of dispersion
x=c(5092582,5123477,5030812,5030809,5247125)
> r=max(x)-min(x)
> cat("The range is",r,"\n")
The range is 216316
> q1=quantile(x,1/4)
> q3=quantile(x,3/4)
> QD=(q3-q1)/2
> cat("The quartile deviation",QD,"\n")
The quartile deviation 46332.5
> coeQD=(q1-q3/q1+q3)
> cat("The coefficient of quartile deviation is",coeQD,"\n")
The coefficient of quartile deviation is 10154288
> m=mean(x)
> s=sum(abs(x-m))
> n=length(x)
> MD=s/n
> cat("The mean deviation is",MD,"\n")
The mean deviation is 64272
> coMD=MD/m
> cat("The coefficient of mean deviation is",coMD,"\n")
The coefficient of mean deviation is 0.01259011
> SD=sd(x)
> cat("The standard deviation is",SD,"\n")
The standard deviation is 89027.07
BOXPLOT
x=c(5092582,5123477,5030812,5030809,5247125,5401831)
y=c(6840751,6876522,6769187,6769187,701954,7198168)
boxplot(x~y,main="Boxplot",xlab="LOWERCI ",ylab="UPPERCI",col="pink",border="blue")
SCATTER PLOT
x=c(4200,9800,10700,13200,9100,14700)
y=c(4259800,4269600,4280300,4293500,4302600,4317300)
plot(x,y,pch=16,main="scatter plot",xlab="UPPERCI",ylab="LOWERCI",col="blue")
abline(lm(y~x),col="red")
Correlation Analysis
> r=cor(x,y,method="pearson")
> R=cor(x,y,method="spearman")
> cat(" The Karl Pearson correlation coefficient is =",r,"\n")
The Karl Pearson correlation coefficient is = 0.7805292
> cat(" The Spearman rank correlation coefficient is =",R)
The Spearman rank correlation coefficient is = 0.6571429>
>