******************************************************************************** Create variable for firm id ******************************************************************************** generate Firm_id = _n ******************************************************************************** Reshape data struture ******************************************************************************** reshape long sales sga goodwill intangibles cogs opinc empl fcfsh commondiv prefdiv cfo, i(Firm_id) j(Time_id) ******************************************************************************** Remove errors ******************************************************************************** generate sales1=. replace sales1=sales if sales>=0 generate sga1=. replace sga1=sga if sga>=0 generate goodwill1=. replace goodwill1= goodwill if goodwill >=0 generate intangibles1=. replace intangibles1= intangibles if intangibles >=0 generate cogs1=. replace cogs1= cogs if cogs >=0 generate empl1=. replace empl1=empl if empl >=0 generate fcfsh1=. replace fcfsh1=fcfsh if fcfsh >=0 generate commondiv1=. replace commondiv1=commondiv if commondiv>=0 generate prefdiv1=. replace prefdiv1=prefdiv if prefdiv>=0 ******************************************************************************** Notes: ssc install winsor2 (εγκατάσταση εντολής winsor2 – ενδέχεται να υπάρχει ήδη). winsor2 vr1, cuts (1 99) suffix(_new) trim [εντολή trimming] winsor2 vr1_new, cuts (5 95) suffix(_new) [εντολή winsorization] ********************************************************************************