Dear Stata experts,
I have an immense patent dataset with company names and ids. Some of the company ids are missing and I would like to fill them by looking them up based on the company names from rows in which they are matched. Here is an example of the issue:
Through what commands could I fill those missing values with the ids given that the ids are matched to a company at least in one row for for all companies? Please bear in mind that this is a very simplistic representation of my dataset. I would need something similar to the lookup method in excel. Thank you in advance!
I have an immense patent dataset with company names and ids. Some of the company ids are missing and I would like to fill them by looking them up based on the company names from rows in which they are matched. Here is an example of the issue:
patent_id | company_id | company_name |
1 | 1 | company1 |
2 | . | company2 |
3 | . | company3 |
4 | 2 | company2 |
5 | . | company3 |
6 | . | company1 |
7 | 3 | company3 |
8 | . | company1 |
9 | . | company2 |
Comment