-
Notifications
You must be signed in to change notification settings - Fork 0
/
DSDC.R
253 lines (163 loc) · 7.86 KB
/
DSDC.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
#Importing Developed EU Countries csv into DataFrame
Developed_countries <- read.csv("Developed_countries.csv", header = TRUE)
names(Developed_countries)
head(Developed_countries)
tail(Developed_countries)
str(Developed_countries)
summary(Developed_countries)
#Importing UnderDeveloped EU Countries csv into DataFrame
UnderDeveloped_countries <- read.csv("UnderDeveloped_countries.csv", header = TRUE)
names(UnderDeveloped_countries)
head(UnderDeveloped_countries)
tail(UnderDeveloped_countries)
str(UnderDeveloped_countries)
summary(UnderDeveloped_countries)
#Finding Mean of Total Population of Developed Countries
mean(Developed_countries$Total_Population)
#Finding Mean of Total Population of UnderDeveloped Countries
mean(UnderDeveloped_countries$Total_Population)
#Finding Median of Total Population of Developed Countries
median(Developed_countries$Total_Population)
#Finding Median of Total Population of UnderDeveloped Countries
median(UnderDeveloped_countries$Total_Population)
#Finding mode of Total Population of Developed Countries
mode(Developed_countries$Total_Population)
#Finding mode of Total Population of UnderDeveloped Countries
mode(UnderDeveloped_countries$Total_Population)
#Finding Standard Deviation of Total Population of Developed Countries
sd(Developed_countries$Total_Population)
#Finding Standard Deviation of Total Population of UnderDeveloped Countries
sd(UnderDeveloped_countries$Total_Population)
#Install moments for skewness and kurtosis
installed.packages("moments")
library("moments")
#Finding skewness of Total Population of Developed Countries
skewness(Developed_countries$Total_Population)
hist(Developed_countries$Total_Population)
#Finding skewness of Total Population of UnderDeveloped Countries
skewness(UnderDeveloped_countries$Total_Population)
hist(UnderDeveloped_countries$Total_Population)
#Finding kurtosis of Total Population of Developed Countries
kurtosis(Developed_countries$Total_Population)
hist(Developed_countries$Total_Population)
#Finding kurtosis of Total Population of UnderDeveloped Countries
kurtosis(UnderDeveloped_countries$Total_Population)
hist(UnderDeveloped_countries$Total_Population)
########################################GDP DESCRIPTIVE###########################
#Finding Mean of GDP_US_DOLLARS of Developed Countries
mean(Developed_countries$GDP_US_DOLLARS)
#Finding Mean of GDP_US_DOLLARS of UnderDeveloped Countries
mean(UnderDeveloped_countries$GDP_US_DOLLARS)
#Finding Median of GDP_US_DOLLARS of Developed Countries
median(Developed_countries$GDP_US_DOLLARS)
#Finding Median of GDP_US_DOLLARS of UnderDeveloped Countries
median(UnderDeveloped_countries$GDP_US_DOLLARS)
#Finding mode of GDP_US_DOLLARS of Developed Countries
mode(Developed_countries$GDP_US_DOLLARS)
#Finding mode of GDP_US_DOLLARS of UnderDeveloped Countries
mode(UnderDeveloped_countries$GDP_US_DOLLARS)
#Finding Standard Deviation of GDP_US_DOLLARS of Developed Countries
sd(Developed_countries$GDP_US_DOLLARS)
#Finding Standard Deviation of GDP_US_DOLLARS of UnderDeveloped Countries
sd(UnderDeveloped_countries$GDP_US_DOLLARS)
#Install moments for skewness and kurtosis
installed.packages("moments")
library("moments")
#Finding skewness of GDP_US_DOLLARS of Developed Countries
skewness(Developed_countries$GDP_US_DOLLARS)
hist(Developed_countries$GDP_US_DOLLARS)
#Finding skewness of GDP_US_DOLLARS of UnderDeveloped Countries
skewness(UnderDeveloped_countries$GDP_US_DOLLARS)
hist(UnderDeveloped_countries$GDP_US_DOLLARS)
#Finding kurtosis of GDP_US_DOLLARS of Developed Countries
kurtosis(Developed_countries$GDP_US_DOLLARS)
hist(Developed_countries$GDP_US_DOLLARS)
#Finding kurtosis of GDP_US_DOLLARS of UnderDeveloped Countries
kurtosis(UnderDeveloped_countries$GDP_US_DOLLARS)
hist(UnderDeveloped_countries$GDP_US_DOLLARS)
#Finding skewness of Percentage_Total_Unemployment of Developed Countries
skewness(Developed_countries$Percentage_Total_Unemployment)
hist(Developed_countries$Percentage_Total_Unemployment)
#Finding skewness of Percentage_Total_Unemployment of UnderDeveloped Countries
skewness(UnderDeveloped_countries$Percentage_Total_Unemployment)
hist(UnderDeveloped_countries$Percentage_Total_Unemployment)
#Finding kurtosis of Percentage_Total_Unemployment of Developed Countries
kurtosis(Developed_countries$Percentage_Total_Unemployment)
hist(Developed_countries$Percentage_Total_Unemployment)
#Finding kurtosis of Percentage_Total_Unemployment of UnderDeveloped Countries
kurtosis(UnderDeveloped_countries$Percentage_Total_Unemployment)
hist(UnderDeveloped_countries$Percentage_Total_Unemployment)
#Histogram of Unemployment rate
hist(Developed_countries$Percentage_Total_Unemployment)
hist(UnderDeveloped_countries$Percentage_Total_Unemployment)
#Histogram of GDP_US_DOLLARS
hist(Developed_countries$GDP_US_DOLLARS)
hist(UnderDeveloped_countries$GDP_US_DOLLARS)
#Finding Outliers in Population for UnderDeveloped Countries.
boxplot(UnderDeveloped_countries$Total_Population,
ylab="Underdeveloped EU Total Population",
col="orange",
border="brown"
)
out <- boxplot.stats(UnderDeveloped_countries$Total_Population)$out
out_ind <- which(UnderDeveloped_countries$Total_Population %in% c(out))
out_ind
UnderDeveloped_countries[out_ind,]
#Finding Outliers in GDP for UnderDeveloped Countries
boxplot(UnderDeveloped_countries$GDP_US_DOLLARS,
ylab="UnderDeveloped EU GDP",
col="orange",
border="brown"
)
out_1 <- boxplot.stats(UnderDeveloped_countries$GDP_US_DOLLARS)$out
out1_ind <- which(UnderDeveloped_countries$GDP_US_DOLLARS %in% c(out_1))
out1_ind
UnderDeveloped_countries[out1_ind,]
#Finding Outliers in Percentage_Total_Unemployment for UnderDeveloped Countries
boxplot(UnderDeveloped_countries$Percentage_Total_Unemployment,
ylab="Percentage_Total_Unemployment",
col="orange",
border="brown"
)
out_2 <- boxplot.stats(UnderDeveloped_countries$Percentage_Total_Unemployment)$out
out2_ind <- which(UnderDeveloped_countries$Percentage_Total_Unemployment %in% c(out_2))
out2_ind
UnderDeveloped_countries[out2_ind,]
#Finding Outliers in Population for Developed Countries.
boxplot(Developed_countries$Total_Population,
ylab="Developed EU Total Population",
col="orange",
border="brown"
)
out_3 <- boxplot.stats(Developed_countries$Total_Population)$out
out3_ind <- which(Developed_countries$Total_Population %in% c(out_3))
out3_ind
Developed_countries[out3_ind,]
#Finding Outliers in GDP for Developed Countries
boxplot(Developed_countries$GDP_US_DOLLARS,
ylab="Developed EU GDP",
col="orange",
border="brown"
)
out_4 <- boxplot.stats(Developed_countries$GDP_US_DOLLARS)$out
out4_ind <- which(Developed_countries$GDP_US_DOLLARS %in% c(out_4))
out4_ind
Developed_countries[out4_ind,]
#Finding Outliers in Percentage_Total_Unemployment for Developed Countries
boxplot(Developed_countries$Percentage_Total_Unemployment,
ylab="Developed EU Percentage of Total Unemployment",
col="orange",
border="brown"
)
out_5 <- boxplot.stats(Developed_countries$Percentage_Total_Unemployment)$out
out5_ind <- which(Developed_countries$Percentage_Total_Unemployment %in% c(out_5))
out5_ind
Developed_countries[out5_ind,]
#Performing Null Hypothesis & Alternative Hypothesis for Developed EU
jarque.test(Developed_countries$Percentage_Total_Unemployment)
jarque.test(Developed_countries$Total_Population)
jarque.test(Developed_countries$GDP_US_DOLLARS)
#Performing Null Hypothesis & Alternative Hypothesis for Underdeveloped EU
jarque.test(UnderDeveloped_countries$Percentage_Total_Unemployment)
jarque.test(UnderDeveloped_countries$Total_Population)
jarque.test(UnderDeveloped_countries$GDP_US_DOLLARS)