Dear Statalisters,
Below I present my pretend data, desired outcome, and my code. My code runs, but not the desired outcome. Could you help ?
my pretend data - gvkey is firm unique id.
what I want
basically I expand each gvkey to incorporate all distinct sic for the entire sample.
my code
Thank you,
Rochelle
Below I present my pretend data, desired outcome, and my code. My code runs, but not the desired outcome. Could you help ?
my pretend data - gvkey is firm unique id.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int(gvkey sic) byte sale 9375 100 10 8596 115 22 8596 6552 31 8596 7374 36 end
what I want
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int(gvkey sic) str2 sale 9375 100 "10" 9375 115 "." 9375 6552 "." 9375 7374 "." 8596 100 "." 8596 115 "22" 8596 6552 "31" 8596 7374 "36" end
my code
Code:
clear input int(gvkey sic) byte sale 9375 100 10 8596 115 22 8596 6552 31 8596 7374 36 end tempfile main save `main' keep sic duplicates drop tempfile siclist save `siclist' use `main' cross using `siclist'
Rochelle
Comment