In: Statistics and Probability
Compare ‘all data’ of Maradi and Zinder using a histogram. Do both regions have the same distribution? If they are different, how are they different? Explain your answer using modality and skewness.Can you answer using R.
GW Maradi
XCoor |
YCoor |
Water Depth (m) |
7.009722 |
14.63611 |
44.19 |
8.110833 |
13.83306 |
38.12 |
7.674445 |
13.40667 |
83.29 |
7.686389 |
13.36861 |
90.58 |
7.705555 |
13.38583 |
73.65 |
7.723889 |
13.40278 |
59.33 |
7.724444 |
13.39583 |
55.87 |
7.741667 |
13.50806 |
46.87 |
7.509444 |
13.84056 |
63.4 |
7.617778 |
13.34333 |
87.3 |
7.628056 |
13.39444 |
61.39 |
7.694167 |
13.31083 |
65.67 |
7.710556 |
13.32056 |
69.35 |
7.755556 |
13.47111 |
50.95 |
7.842778 |
13.50667 |
49.63 |
7.566667 |
13.35333 |
56.59 |
7.588611 |
13.36778 |
67.65 |
7.59 |
13.39972 |
58.43 |
7.592778 |
13.30917 |
65.43 |
7.683889 |
13.27306 |
66.05 |
7.459167 |
13.50667 |
46.95 |
7.460278 |
13.44361 |
40.3 |
7.467778 |
13.41583 |
70.15 |
7.503889 |
13.40056 |
70.72 |
7.509722 |
13.44306 |
35.73 |
7.521667 |
13.44583 |
37.3 |
7.537222 |
13.43917 |
42.55 |
7.540555 |
13.41833 |
43.95 |
7.540833 |
13.4075 |
46.83 |
7.423056 |
13.39917 |
55.47 |
7.443056 |
13.38917 |
60.44 |
GW ZInder
XCoor |
YCoor |
GW Depth (m) |
8.84 |
14.15361 |
52.75 |
8.898611 |
14.15889 |
53.7 |
8.942778 |
14.16833 |
54 |
8.876389 |
14.19417 |
57.85 |
8.907222 |
14.09028 |
61.4 |
8.9225 |
14.11444 |
61.75 |
8.898611 |
14.15889 |
54 |
8.942778 |
14.16833 |
55.3 |
8.84 |
14.15361 |
57.7 |
8.876389 |
14.19417 |
57.9 |
8.9225 |
14.11444 |
59.25 |
8.907222 |
14.09028 |
61.5 |
8.84 |
14.15361 |
52.3 |
8.898611 |
14.15889 |
54.9 |
8.876389 |
14.19417 |
56.9 |
8.942778 |
14.16833 |
56.9 |
8.9225 |
14.11444 |
58.3 |
8.907222 |
14.09028 |
60.8 |
Answer :-
Required R-code and R-output is given as follows;
c=file.choose() # Select the file in which data is saved
c
D=read.delim(c)
View(D1) # To view data is correct or not
D1=D[,-7]
D_GW_Maradi=as.matrix(D1[,1:3])
D_GW_ZInder=as.matrix(D1[-(19:31),3:6])
par(mfrow=c(1,2))
plot(density(D_GW_Maradi),col="red",ylim=c(0,0.035),main =
"Histogram of GW Maradi Data")
hist(D_GW_Maradi,probability =TRUE,add=T)
plot(density(D_GW_ZInder),col="red",ylim=c(0,0.03),main =
"Histogram of GW ZInder Data")
hist(D_GW_ZInder,prob=T,add=T)
Looking at these two histogram following conclusions can be drawn;
1). Two histograms are similar but not exact same ,
a). Histogram of GW Maradi has two modes ( i.e. modality is two ), while
b). Histogram of GW Zlnder has three modes (i.e. modality is three )
c). But shape of both histogram is same.
2). About skewness ( Skewness is lack of symmetry in data)
a). From Histogram of GW Maradi it can be seen that the data is positively skewed.
b).From Histogram of GW Zinder we can not say anything about data but it also seems to be a kind of positively skewed data
OR
If you just want histogram of these two data sets then just remove the command plot(density()), and you will get histogram of raw data without probabilities and density curve. But still conclusions remains same
R- codes will became
c=file.choose() # Select the file in which data is saved
c
D=read.delim(c)
View(D1) # To view data is correct or not
D1=D[,-7]
D_GW_Maradi=as.matrix(D1[,1:3])
D_GW_ZInder=as.matrix(D1[-(19:31),3:6])
hist(D_GW_Maradi,main = "Histogram of GW Maradi Data")
hist(D_GW_ZInder,main = "Histogram of GW ZInder Data")