-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmetrgui_v22.py
504 lines (431 loc) · 22.3 KB
/
metrgui_v22.py
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
from msilib.schema import ComboBox
from tkinter import *
from tkinter import ttk
import tkinter
import tkinter.font as tkfont
from PIL import Image
import pandas as pd
import json
import csv
import matplotlib
matplotlib.use('TkAgg')
import numpy as np
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg, NavigationToolbar2Tk)
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
import seaborn as sns
import METR_functions as fun
import threading
'''
-----------------------------------------------------------------------------------------------
Read the data for METR parameters
-----------------------------------------------------------------------------------------------
'''
# data1 = pd.read_excel('metr_paramsnew.xlsx')
#data1 = pd.read_excel('metr_paramsnew.xlsx')
data1 = pd.read_csv('metr_paramscentam.csv')
country_list = []
for countries in data1['Country']:
country_list+=[countries]
country_list.sort()
sector_list = [' ', 'Manufacturing', 'Services', 'Other']
#asset_list = ['equipment', 'building', 'Land', 'Inventory']
'''Convert csv to json file '''
#file = open('metr_paramsnew.csv')
file = open('metr_paramscentam.csv')
data = csv.DictReader(file)
dict={}
for rows in data:
key = rows['Country']
dict[key] = rows
with open('metrparams1.json', 'w') as jsonf:
jsonString = json.dumps(dict, indent=3)
jsonf.write(jsonString)
'''Read the json file '''
with open('metrparams1.json') as file:
data = json.load(file)
'''
-----------------------------------------------------------------------------------------------
Create an interface
-----------------------------------------------------------------------------------------------
'''
root = Tk()
'''Specify the interface size'''
#getting screen width and height of display
win_width= root.winfo_screenwidth()
win_height= root.winfo_screenheight()
#setting tkinter window size
root.geometry("%dx%d" % (win_width, win_height))
#root.attributes('-fullscreen', True)
'''Change the window logo'''
img=Image.open('wblogo.png')
img.save('icon.ico', format='ICO', sizes=[(30,30)])
root.iconbitmap('icon.ico')
root.title('World Bank')
'''Create a frame in root'''
frame_width='800'
frame_height='800'
bg_color1 = 'white'
bg_color2 = '#D3D3D3'
frame1=Frame(root, background=bg_color1, height=frame_height, width=frame_width)
frame1.config(relief=RIDGE, padx=2, pady=2, border=1, borderwidth=1,
highlightbackground='black', highlightthickness=1)
frame1.place(relx=0.5, rely=0.1)
# frame2=Frame(root, background=bg_color1, height=frame_height, width=frame_width)
# #frame2.place(relx=0.75, rely=0.1, anchor='nw')
# frame3=Frame(root, background=bg_color1, height=frame_height, width=frame_width)
# #frame3.place(relx=0.5, rely=0.52)
# frame4=Frame(root, background=bg_color1, height=frame_height, width=frame_width)
# #frame4.place(relx=0.75, rely=0.52)
""" frame_list=[frame1, frame2, frame3, frame4]
for frame in frame_list:
frame.config(relief=RIDGE, padx=2, pady=2, border=1, borderwidth=1,
highlightbackground='black', highlightthickness=1)
"""
'''Specify font style'''
fontStyle_title = tkfont.Font(family="Arial", size="24", weight="bold")
fontStyle_sub_title = tkfont.Font(family="Times", size="18", weight="bold")
fontStyle_sub_sub_title = tkfont.Font(family="Times", size="15", weight="bold")
fontStyle_text = tkfont.Font(family="Andes", size="14", weight="normal")
fontStyle_comment = tkfont.Font(family="Andes", size="10", weight="normal")
'''Specify width of entry widgets'''
entry_width=10
''' Create and place a title at the top '''
Title = Label(root, text='ETR MODEL', font= fontStyle_title)
Title.config(bg='blue', fg='white')
Title.place(relx=0.5, y=0, anchor='n')
'''Create units for positioning widgets'''
x_init = 0.05
x_right_step = 0.15
y_init = 0.1
y_down_step = 0.04
'''Create a command for action when a country / asset is selected '''
tax_param_list=['Corporate income tax rate', 'Personal income tax rate', 'Asset tax rate',
'Capital input salestax rate', 'Capital transfer tax rate','Dividend distribution tax rate',
'Dividend tax rate', 'Capital gains tax rate','Property tax rate', 'Tax depr (equipment)',
'Tax depr (building)', 'Investment allowance']
corp_param_list=['Debt asset ratio', 'Dividend payout ratio', 'Weight - equipment', 'Weight - building',
'Weight - land', 'Weight - inventory']
data_col_list=['Country', 'CIT_rate_2019', 'CIT_rate_2020', 'inflation', 'tax_depreciation_building',
'tax_depreciation_equipment', 'inventory_accounting', 'asset_tax',
'capital_input_sale_tax', 'capital_transfer_tax', 'financial_transfer_tax_flag',
'dividend_payout_ratio', 'dividend_distribution_tax', 'domestic_tax_rate_dividend',
'international_interest_rate', 'debt_asset_ratio', 'domestic_pit_interest',
'domestic_pit_capital_gain', 'economic_depreciation_equipment',
'economic_depreciation_building', 'investment_allowance_equipment',
'investment_allowance_building', 'property_tax', 'mining_royalty',
'capital_weight_equipment', 'capital_weight_building', 'capital_weight_land',
'capital_weight_inventory']
data_taxparam_col_list = ['CIT_rate_2020', 'domestic_pit_interest', 'asset_tax', 'capital_input_sale_tax',
'capital_transfer_tax', 'dividend_distribution_tax', 'domestic_tax_rate_dividend',
'domestic_pit_capital_gain','property_tax', 'tax_depreciation_equipment',
'tax_depreciation_building', 'investment_allowance_equipment']
data_corpparam_col_list=['debt_asset_ratio', 'dividend_payout_ratio', 'capital_weight_equipment',
'capital_weight_building', 'capital_weight_land','capital_weight_inventory']
def selected_country_params(event):
#Disable sector selection
sector['state'] = 'disabled'
METR['METR - Equipment'].delete(0, END)
METR['METR - Buildings'].delete(0, END)
METR['METR - Land'].delete(0, END)
METR['METR - Inventory'].delete(0, END)
METR['METR - Overall'].delete(0, END)
rg.delete(0, END)
rn.delete(0, END)
EATR.delete(0, END)
inv_acc.delete(0, END)
inv_acc.insert(0, data[country.get()]['inventory_accounting'])
eco_param_val['Inflation rate'].delete(0, END)
eco_param_val['Inflation rate'].insert(0, data[country.get()]['inflation'])
eco_param_val['Economic depr (equipment)'].delete(0, END)
eco_param_val['Economic depr (equipment)'].insert(0, data[country.get()]['economic_depreciation_equipment'])
eco_param_val['Economic depr (building)'].delete(0, END)
eco_param_val['Economic depr (building)'].insert(0, data[country.get()]['economic_depreciation_building'])
eco_param_val['Interest rate'].delete(0, END)
eco_param_val['Interest rate'].insert(0, data[country.get()]['international_interest_rate'])
i=0
for param in tax_param_list:
tax_param_val[param].delete(0, END)
tax_param_val[param].insert(0, data[country.get()][data_taxparam_col_list[i]])
i+=1
i=0
for param in corp_param_list:
corp_param_val[param].delete(0, END)
corp_param_val[param].insert(0, data[country.get()][data_corpparam_col_list[i]])
i+=1
'''default value of 15% for infra-marginal ROR '''
ror.delete(0, END)
ror.insert(0, 0.15)
def selected_sector_params(event):
country['state'] = 'disabled'
def enable_CB_sector():
sector['state'] = 'normal'
country['state'] = 'disabled'
def enable_CB_country():
country['state'] = 'normal'
sector['state'] = 'disabled'
sector.current(0)
''' Create a scatter plot of METR by country in frame 1 '''
df=pd.read_csv('centam_countries.csv')
df=df[['Country', 'CIT_rate_2020', 'METR_Overall']]
df=df[(df['METR_Overall']<1)&(df['METR_Overall']>-1)]
fig=Figure(figsize=(7, 7))
ax1=fig.add_subplot(111)
ax1.scatter(df.CIT_rate_2020, df.METR_Overall, c=df.METR_Overall)
for country in df.Country:
ax1.text(df.CIT_rate_2020[df.Country==country], df.METR_Overall[df.Country==country], country[:3])
ax1.set_title('METR by country', fontsize=24, color='black', weight='bold')
ax1.set_xlabel('CIT rate', fontsize=18, color='blue', weight='bold')
ax1.set_ylabel('METR', fontsize=18, color='blue', weight='bold')
canvas = FigureCanvasTkAgg(fig, master=frame1)
canvas.get_tk_widget().pack()
canvas.draw()
''' Create a function to compute METR params'''
def calc_metr():
#Economic params
for widget in frame1.winfo_children():
widget.destroy()
pi = float(eco_param_val['Inflation rate'].get())
delta_E = float(eco_param_val['Economic depr (equipment)'].get())
delta_B= float(eco_param_val['Economic depr (building)'].get())
r_d= float(eco_param_val['Interest rate'].get())
#Tax params
u= float(tax_param_val['Corporate income tax rate'].get())
m= float(tax_param_val['Personal income tax rate'].get())
alpha_E= float(tax_param_val['Tax depr (equipment)'].get())
alpha_B = float(tax_param_val['Tax depr (building)'].get())
#asset_tax_rate=tax_param_val['Asset tax rate'].get()
T_d= float(tax_param_val['Capital input salestax rate'].get())
T_L= float(tax_param_val['Capital transfer tax rate'].get())
ddt= float(tax_param_val['Dividend distribution tax rate'].get())
t_div= float(tax_param_val['Dividend tax rate'].get())
t_g= float(tax_param_val['Capital gains tax rate'].get())
T_P= float(tax_param_val['Property tax rate'].get())
phi= float(tax_param_val['Investment allowance'].get())
inv_acc_val = inv_acc.get()
if inv_acc_val == 'FIFO':
p_FIFO = 1
else:
p_FIFO = 0
#p_FIFO = float(inv_acc.get())
#Corp params
beta= float(corp_param_val['Debt asset ratio'].get())
dpr= float(corp_param_val['Dividend payout ratio'].get())
#r_d = r_d + pi
t_rho=fun.get_tax_rate_equity(dpr, t_div, ddt, t_g)
print("tax rate on equity income is ", t_rho)
rho_n=fun.get_cost_of_equity(r_d, m, t_rho)
print("cost of equity is ", rho_n)
r_f=fun.get_cost_of_financing(r_d, beta, u, rho_n)
print("cost of financing is ", r_f)
r_n=fun.get_hurdle_rate(beta, r_d, rho_n, pi)
print("hurdle rate of return is ", r_n)
#npv of depr allowances
Z_E = fun.NPV_Depr(phi, alpha_E, r_f, SLM=False)
print("NPV of tax depr allowances for equipment is ", Z_E)
Z_B = fun.NPV_Depr(0, alpha_B, r_f, SLM=False)
print("NPV of tax depr allowances for buildings is ", Z_B)
#gross pre tax ROR for assets
r_g_E = fun.gross_pretax_rate_equip_bld(T_d, r_f, pi, delta_E, u, Z_E)
print("Gross pre-tax marginal rate of return (equipment) is ", r_g_E)
r_g_B = fun.gross_pretax_rate_equip_bld(T_d, r_f, pi, delta_B, u, Z_B)
print("Gross pre-tax marginal rate of return (buildings) is ", r_g_B)
r_g_L = fun.gross_pretax_rate_land(r_f, pi, u, T_L, T_P)
print("Gross pre-tax marginal rate of return (Land) is ", r_g_L)
r_g_I = fun.gross_pretax_rate_inventory(r_f, pi, u, p_FIFO)
print("Gross pre-tax marginal rate of return (inventory) is ", r_g_I)
metr_E = fun.METR(r_g_E, r_n)
print("METR (equipment) is ", metr_E)
metr_B = fun.METR(r_g_B, r_n)
print("METR (buildings) is ", metr_B)
metr_L = fun.METR(r_g_L, r_n)
print("METR (land) is ", metr_L)
metr_I = fun.METR(r_g_I, r_n)
print("METR (inventory) is ", metr_I)
wt_eq = float(corp_param_val['Weight - equipment'].get())
wt_bld = float(corp_param_val['Weight - building'].get())
wt_land= float(corp_param_val['Weight - land'].get())
wt_inv= float(corp_param_val['Weight - inventory'].get())
metr_overall = (wt_eq*metr_E + wt_bld*metr_B + wt_land*metr_L + wt_inv*metr_I)
print("METR (overall) is ", metr_overall)
r_g_overall = r_n/(1 - metr_overall)
print("r_g_overall is ", r_g_overall)
metr_E = "{:.2%}".format(fun.METR(r_g_E, r_n))
metr_B = "{:.2%}".format(fun.METR(r_g_B, r_n))
metr_L = "{:.2%}".format(fun.METR(r_g_L, r_n))
metr_I = "{:.2%}".format(fun.METR(r_g_I, r_n))
r_infra = float(ror.get())
eatr = "{:.2%}".format(fun.get_EATR(r_g_overall, r_infra, u, metr_overall))
METR['METR - Equipment'].delete(0, END)
METR['METR - Equipment'].insert(0, metr_E)
METR['METR - Buildings'].delete(0, END)
METR['METR - Buildings'].insert(0, metr_B)
METR['METR - Land'].delete(0, END)
METR['METR - Land'].insert(0, metr_L)
METR['METR - Inventory'].delete(0, END)
METR['METR - Inventory'].insert(0, metr_I)
METR['METR - Overall'].delete(0, END)
METR['METR - Overall'].insert(0, "{:.2%}".format(metr_overall))
EATR.delete(0, END)
EATR.insert(0, eatr)
rg.delete(0, END)
rg.insert(0, "{:.2%}".format(r_g_overall))
rn.delete(0, END)
rn.insert(0, "{:.2%}".format(r_n))
#con_name=country.get()
fig=Figure(figsize=(7, 7))
ax1=fig.add_subplot(111)
ax1.scatter(df.CIT_rate_2020, df.METR_Overall, c=df.METR_Overall)
ax1.set_title('METR by country', fontsize=24, color='black', weight='bold')
ax1.set_xlabel('CIT rate', fontsize=18, color='blue', weight='bold')
ax1.set_ylabel('METR', fontsize=18, color='blue', weight='bold')
ax1.scatter(u, metr_overall)
#ax1.text(u, metr_overall, con_name[:3], fontsize=18, color='red')
for country in df.Country:
ax1.text(df.CIT_rate_2020[df.Country==country], df.METR_Overall[df.Country==country], country[:3])
#ax1.text(u, metr_overall, con_name[:3], fontsize=18, color='red')
plt.show()
canvas = FigureCanvasTkAgg(fig, master=frame1)
canvas.get_tk_widget().pack()
canvas.draw()
'''Create a label & Combobox for selecting country '''
country_label=Label(root, text='Select country', font=fontStyle_sub_title)
country_label.config(fg="blue")
country_label.place(relx=x_init, rely=y_init, anchor='w')
country = ttk.Combobox(root, value = country_list, font=fontStyle_text, state='normal')
country.place(relx=x_init, rely=(y_init+y_down_step), anchor='w')
country.current()
country.bind('<<ComboboxSelected>>', selected_country_params)
""" '''Create a label & Combobox for selecting Sector '''
sector_label=Label(root, text='Select Sector', font=fontStyle_sub_title)
sector_label.config(fg="blue")
sector_label.place(relx=(x_init+x_right_step), rely=(y_init), anchor='w')
sector = ttk.Combobox(root, value = sector_list)
sector.place(relx=(x_init+x_right_step), rely=(y_init+y_down_step), anchor='w')
sector.current()
sector.bind('<<ComboboxSelected>>', selected_sector_params) """
'''Create a label & Combobox for selecting Sector '''
Sector_label=Label(root, text='Select Sector', font=fontStyle_sub_title)
Sector_label.config(fg="blue")
Sector_label.place(relx=(x_init+x_right_step), rely=(y_init), anchor='w')
sector = ttk.Combobox(root, value = sector_list, font=fontStyle_text, state='normal')
sector.place(relx=(x_init+x_right_step), rely=(y_init+y_down_step), anchor='w')
sector.current(0)
sector.bind('<<ComboboxSelected>>', selected_sector_params)
'''Create a Label and Combobox for selecting inventory accounting'''
#inv_acc_list = ['FIFO', 'LIFO', 'Optional']
Inv_label = Label(root, text='Inventory accounting', font=fontStyle_sub_title)
Inv_label.configure(fg="blue")
Inv_label.place(relx=x_init+2*x_right_step, rely=y_init, anchor='w')
inv_acc = Entry(root, width=entry_width, font=fontStyle_text)
inv_acc.place(relx=x_init+2*x_right_step, rely=y_init+y_down_step, anchor='w')
Inv_label2 = Label(root, text='FIFO = 1, Other = 0', font=fontStyle_comment)
Inv_label2.configure(fg="grey")
Inv_label2.place(relx=x_init+2*x_right_step, rely=y_init+1.5*y_down_step, anchor='w')
# inv_acc = ttk.Combobox(root, value = inv_acc_list, font=fontStyle_text, state='normal')
# inv_acc.place(relx=x_init+2*x_right_step, rely=y_init+y_down_step, anchor='w')
# inv_acc.current(0)
# inv_acc.bind('<<ComboboxSelected>>', selected_inv_acc)
''' Create a Label and entry widget for economic params '''
ecoparam_label = Label(root, text='Economic parameters', font=fontStyle_sub_title)
ecoparam_label.config(fg="blue")
ecoparam_label.place(relx=x_init, rely=(y_init+2*y_down_step), anchor='w')
econ_param_list=['Inflation rate', 'Economic depr (equipment)', 'Economic depr (building)',
'Interest rate']
num=3
eco_param_val = {}
for param in econ_param_list:
label = Label(root, text=param, font=fontStyle_text)
label.place(relx=x_init, rely=(y_init+num*y_down_step), anchor='w')
eco_param_val[param] = Entry(root, width=entry_width, font=fontStyle_text)
eco_param_val[param].place(relx=x_init+x_right_step, rely=(y_init+num*y_down_step), anchor='w')
num+=1
''' Create a Label and entry widget for tax params '''
taxparam_label = Label(root, text='Tax parameters', font=fontStyle_sub_title)
taxparam_label.config(fg="blue")
taxparam_label.place(relx=x_init, rely=(y_init+num*y_down_step), anchor='w')
tax_param_list1=['Corporate income tax rate', 'Personal income tax rate', 'Tax depr (equipment)',
'Tax depr (building)', 'Asset tax rate', 'Capital input salestax rate',
'Capital transfer tax rate', 'Dividend distribution tax rate',
'Dividend tax rate', 'Capital gains tax rate','Property tax rate', 'Investment allowance']
num+=1
tax_param_val={}
for param in tax_param_list1:
label = Label(root, text=param, font=fontStyle_text)
label.place(relx=x_init, rely=(y_init+num*y_down_step), anchor='w')
tax_param_val[param] = Entry(root, width=entry_width, font=fontStyle_text)
tax_param_val[param].place(relx=x_init+x_right_step, rely=(y_init+num*y_down_step), anchor='w')
num+=1
# '''Create a exit button '''
# exit_button=Button(root, text="Exit", height=1, width=5, command=root.destroy)
# exit_button.config(font=fontStyle_sub_title, fg="red", borderwidth=1)
# exit_button.place(relx=x_init+1.5*x_right_step, rely=y_init+num*y_down_step, anchor='w')
''' Create a Label and entry widget for corporate params '''
corpparam_label = Label(root, text='Corporate parameters', font=fontStyle_sub_title)
corpparam_label.config(fg="blue")
corpparam_label.place(relx=x_init+1.5*x_right_step, rely=(y_init+2*y_down_step), anchor='w')
corp_param_list=['Debt asset ratio', 'Dividend payout ratio', 'Weight - equipment', 'Weight - building',
'Weight - land', 'Weight - inventory']
num1=3
corp_param_val={}
for param in corp_param_list:
label = Label(root, text=param, font=fontStyle_text)
label.place(relx=x_init+1.5*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
corp_param_val[param] = Entry(root, width=entry_width, font=fontStyle_text)
corp_param_val[param].place(relx=x_init+2.25*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
num1+=1
'''Create labels for METR values'''
METR={}
metr_list=['METR - Equipment', 'METR - Buildings', 'METR - Land', 'METR - Inventory', 'METR - Overall']
for metr in metr_list:
label = Label(root, text=metr, font=fontStyle_text)
label.place(relx=x_init+1.5*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
METR[metr] = Entry(root, width=entry_width, font=fontStyle_text, state='normal')
METR[metr].place(relx=x_init+2.25*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
num1+=1
'''Create labels for pre-tax ROR values'''
rglabel = Label(root, text="Marginal pre-tax ROR", font=fontStyle_text)
rglabel.place(relx=x_init+1.5*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
rg = Entry(root, width=entry_width, font=fontStyle_text, state='normal')
rg.place(relx=x_init+2.25*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
num1+=1
'''Create labels for hurdle rate values'''
rnlabel = Label(root, text="Hurdle ROR", font=fontStyle_text)
rnlabel.place(relx=x_init+1.5*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
rn = Entry(root, width=entry_width, font=fontStyle_text, state='normal')
rn.place(relx=x_init+2.25*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
num1+=1
'''Create labels for infra-marginal ROR value for EATR'''
RORlabel = Label(root, text='infra-marginal ROR', font=fontStyle_text)
RORlabel.place(relx=x_init+1.5*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
ror = Entry(root, width=entry_width, font=fontStyle_text, state='normal')
ror.place(relx=x_init+2.25*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
num1+=1
'''Create labels for EATR values'''
EATRlabel = Label(root, text='EATR', font=fontStyle_text)
EATRlabel.place(relx=x_init+1.5*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
EATR = Entry(root, width=entry_width, font=fontStyle_text, state='normal')
EATR.place(relx=x_init+2.25*x_right_step, rely=(y_init+num1*y_down_step), anchor='w')
num1+=1
''' Create a button for computing METR '''
num1+=0
Metr_button = Button(root, text="Compute METR", padx=10, pady=10, command=calc_metr)
Metr_button.config(font=fontStyle_sub_sub_title, fg="red")
#Metr_button.place(relx=x_init+1.5*x_right_step, rely=y_init+num1*y_down_step, anchor="w")
Metr_button.place(relx=x_init+1.5*x_right_step, rely=y_init+(num1+2)*y_down_step, anchor="w")
num1+=0
'''Create a Combobox enable button '''
enable_button1=Button(root, text="Enable Sector", height=1, width=11, command=enable_CB_sector)
enable_button1.config(font=fontStyle_sub_sub_title, fg="red", borderwidth=1)
enable_button1.place(relx=x_init+3.5*x_right_step, rely=y_init+(num1+2)*y_down_step, anchor='w')
num1+=0
'''Create a Combobox enable button '''
enable_button2=Button(root, text="Enable Country", height=1, width=11, command=enable_CB_country)
enable_button2.config(font=fontStyle_sub_sub_title, fg="red", borderwidth=1)
enable_button2.place(relx=x_init+4.1*x_right_step, rely=y_init+(num1+2)*y_down_step, anchor='w')
'''Create a exit button '''
exit_button=Button(root, text="Exit", height=1, width=5, command=root.destroy)
exit_button.config(font=fontStyle_sub_title, fg="red", borderwidth=1)
exit_button.place(relx=x_init+4.8*x_right_step, rely=y_init+(num1+2)*y_down_step, anchor='w')
root.mainloop()