Hello all!
've ran into a problem that I do not know how to solve. I have a Dataset that I will need to manipulate in order to create a easier to read Panel Data. I have four variables, id (which gives me the ID company number in the data set) companyname (the name of the company) status (categorical with 16 different activity types) and a few more that are nonimportant for now.
(Look below to see sample)
As you can see, I have an id and company name which is related to Status. It's the history of the company considering it's activity status. The ID and Companyname do not progress until the whole company status history is printed.
My problem is, I need to make every missing id "." (dot) convert to it's company id and fill company name "blank" with it's corresponding for id as well.
Example (look at table for clarity): obs 173 has id 112 with companyname: EIM (FX) LIMITED status dissolved obs 174 has id . with companyname: status In liquidiation . . .
And I need it to be like this:
How it should be: obs 173 should have id 112 with companyname: EIM (FX) LIMITED status dissolved obs 174 has id 112 with companyname: EIM (FX) LIMITED status In liquidation.And so on, for all the data set.
How can I do a command to do it automatically? I was thinking maybe with a loop?
Any help would be greatly appreciated. Thank you in advance.
've ran into a problem that I do not know how to solve. I have a Dataset that I will need to manipulate in order to create a easier to read Panel Data. I have four variables, id (which gives me the ID company number in the data set) companyname (the name of the company) status (categorical with 16 different activity types) and a few more that are nonimportant for now.
(Look below to see sample)
As you can see, I have an id and company name which is related to Status. It's the history of the company considering it's activity status. The ID and Companyname do not progress until the whole company status history is printed.
My problem is, I need to make every missing id "." (dot) convert to it's company id and fill company name "blank" with it's corresponding for id as well.
Example (look at table for clarity): obs 173 has id 112 with companyname: EIM (FX) LIMITED status dissolved obs 174 has id . with companyname: status In liquidiation . . .
And I need it to be like this:
How it should be: obs 173 should have id 112 with companyname: EIM (FX) LIMITED status dissolved obs 174 has id 112 with companyname: EIM (FX) LIMITED status In liquidation.And so on, for all the data set.
How can I do a command to do it automatically? I was thinking maybe with a loop?
. list | id companyname status in 173/191 | |
id companyname | status | |
173. | 112 EIM (FX) LIMITED | Dissolved |
174. | . | In liquidation |
175. | . | Active |
176. | . | Active (dormant) |
177. | . | Active |
178. | 113 E.ON VERTRIEB DEUTSCHLAND GMBH | Dissolved (merger or take-over) |
179. | 114 PRUDENTIAL ASSURANCE COMPANY LIMITED | Dissolved |
180. | 115 CHEVRON LIMITED | Dissolved |
181. | 116 KOREA TELECOM | Dissolved |
182. | 117 TXU EUROPE GROUP PLC | In liquidation |
183. | . | Active (insolvency proceedings) |
184. | 118 TELSTRA CORPORATION LIMITED | Dissolved |
185. | 119 NORTH SEA GROUP B.V. | Dissolved |
186. | . | Active |
187. | 120 VODAFONE GMBH | Dissolved |
188. | 121 STINNES AG | Dissolved |
189. | 122 VEDIOR NV | Dissolved |
190. | . | Active |
191. | 123 ZURICH LEBENSVERSICHERUNG AKTIENGESELLSCHAFT (DEUTSCHLAND) | Dissolved (merger or take-over) |
Comment