rvs = stats.norm.rvs(loc=5, scale=10, size=(50,2))
stats.ttest_1samp(rvs,5.0)

"""robustness test"""

import pandas as pd
import numpy as np
import Preprocessing_data as preda
import matplotlib.pyplot as plt
import seaborn as sns
# index for deflated data
index = preda.get_index()
# manipulate raw data, prepare data for main analysis
chemicals_raw = preda.get_raw_data('Chemicals_raw.xls')
chem =preda.clean_datechem(chemicals_raw)
old_chem, young_chem, newborn_chem = preda.get_f_wrt_age(chem)
newborn_chem = preda.get_data_newborn(newborn_chem)
'''dataframe of chemicals for the whole period'''
total_chem = pd.concat([old_chem,young_chem,newborn_chem], axis = 0, ignore_index = True)
'''drop some firms that have unreasonable entry, firms with multi-industry, and 
    data for the whole cooperation around the world'''
total_chem = total_chem.drop(total_chem.index[total_chem['ID'].isin([8,21,51,54,156])]).reset_index()
total_chem = total_chem.drop('index', axis = 1)
total_chem.columns = ['ID', 'name',
                      'fa_18', 'fa_17', 'fa_16', 'fa_15', 'fa_14', 'fa_13', 'fa_12', 'fa_11', 'fa_10',
                      'em_18', 'em_17', 'em_16', 'em_15', 'em_14','em_13', 'em_12', 'em_11', 'em_10',
                      'ec_18', 'ec_17', 'ec_16', 'ec_15', 'ec_14', 'ec_13', 'ec_12', 'ec_11', 'ec_10',
                      'mc_18', 'mc_17', 'mc_16','mc_15', 'mc_14', 'mc_13','mc_12', 'mc_11', 'mc_10',
                      's_18', 's_17', 's_16', 's_15', 's_14','s_13','s_12', 's_11', 's_10',
                      'year_cor']
total_chem, total_chem_edit = preda.deflate_data(total_chem, index)
Exemplo n.º 2
0
         eff_elec_dmu.loc[eff_elec_dmu['firm_643'] != 0,'firm_643'],
         color='darkred', linewidth=1, marker='o', markerfacecolor='red', markersize=6)
plt.title('Efficient newborn firms in electronic sector', color='blue', fontsize=20)
plt.ylabel('efficiency score', color='blue', fontsize=14)
'''

################################## MACHINERY ##################################
import pandas as pd
import numpy as np
import Preprocessing_data as preda
import matplotlib.pyplot as plt
#import DEA
index = preda.get_index()
mac = preda.get_raw_data('Machinery_raw.xls')
mac = preda.clean_datemac(mac)
old_mac, young_mac, newborn_mac = preda.get_f_wrt_age(mac)
newborn_mac = preda.get_data_newborn(newborn_mac)
'''dataframe of machinery for the whole period'''
total_mac = pd.concat([old_mac,young_mac,newborn_mac], axis =0, ignore_index = True)
'''drop some firms that have unreasonable entry, firms with multi-industry, and 
    data for the whole cooperation around the world'''
total_mac = total_mac.drop(total_mac.index[total_mac['ID'].isin([271])]).reset_index()
total_mac = total_mac.drop('index', axis = 1)
total_mac.columns = ['ID', 'name',
                      'fa_18', 'fa_17', 'fa_16', 'fa_15', 'fa_14', 'fa_13', 'fa_12', 'fa_11', 'fa_10',
                      'em_18', 'em_17', 'em_16', 'em_15', 'em_14','em_13', 'em_12', 'em_11', 'em_10',
                      'ec_18', 'ec_17', 'ec_16', 'ec_15', 'ec_14', 'ec_13', 'ec_12', 'ec_11', 'ec_10',
                      'mc_18', 'mc_17', 'mc_16','mc_15', 'mc_14', 'mc_13','mc_12', 'mc_11', 'mc_10',
                      's_18', 's_17', 's_16', 's_15', 's_14','s_13','s_12', 's_11', 's_10',
                      'year_cor']
total_mac, total_mac_edit = preda.deflate_data(total_mac,index)
Exemplo n.º 3
0
Created on Tue May  5 20:31:56 2020

@author: DELL
"""

import pandas as pd
import numpy as np
import Preprocessing_data as preda
import matplotlib.pyplot as plt
# index for deflated data
index = preda.get_index()

elec = preda.get_raw_data('Electronics_raw.xls')

elec = preda.clean_dateelec(elec)
old_elec, young_elec, newborn_elec = preda.get_f_wrt_age(elec)
newborn_elec = preda.get_data_newborn(newborn_elec)
'''dataframe of electronic for the whole period'''
total_elec = pd.concat([old_elec, young_elec, newborn_elec],
                       axis=0,
                       ignore_index=True)
'''drop some firms that have unreasonable entry, firms with multi-industry, and 
    data for the whole cooperation around the world'''
total_elec = total_elec.drop(total_elec.index[total_elec['ID'].isin(
    [6, 11, 23, 423, 98, 85])]).reset_index()
total_elec = total_elec.drop('index', axis=1)
total_elec.columns = [
    'ID', 'name', 'fa_18', 'fa_17', 'fa_16', 'fa_15', 'fa_14', 'fa_13',
    'fa_12', 'fa_11', 'fa_10', 'em_18', 'em_17', 'em_16', 'em_15', 'em_14',
    'em_13', 'em_12', 'em_11', 'em_10', 'ec_18', 'ec_17', 'ec_16', 'ec_15',
    'ec_14', 'ec_13', 'ec_12', 'ec_11', 'ec_10', 'mc_18', 'mc_17', 'mc_16',