Hello All,
I have a dataset that contains variables regarding several firms. The variables are the following: Firm Name, Penalty Amount, Year, City, and Domain. My issue is that the same firm appears many times in different years for different occasions, whereas I would strongly like to have one line for each firm. I would highly appreciate if you could advise me if there is a way to restructure the dataset in a way so that I could have one line for each firm followed by all the characteristic in columns. Additionally, to differentiate the added columns, it would have been great if I could add some numbers before added variables, e.g., 1_Penaly Amount, 1_Year, 1City, etx.
To bring you an example, let's say my row dataset looks like this:
I want my dataset to look like the following:
I would really appreciate any support you can give.
Best regards,
Nick
I have a dataset that contains variables regarding several firms. The variables are the following: Firm Name, Penalty Amount, Year, City, and Domain. My issue is that the same firm appears many times in different years for different occasions, whereas I would strongly like to have one line for each firm. I would highly appreciate if you could advise me if there is a way to restructure the dataset in a way so that I could have one line for each firm followed by all the characteristic in columns. Additionally, to differentiate the added columns, it would have been great if I could add some numbers before added variables, e.g., 1_Penaly Amount, 1_Year, 1City, etx.
To bring you an example, let's say my row dataset looks like this:
| Firm Name | Penalty Amount | Year | City | Domain |
| B | 1000$ | 2015 | Barcelona | Medical |
| A | 2500$ | 2016 | Tokyo | Chemical |
| A | 1250$ | 2003 | Rio de Janeiro | Chemical |
| Firm Name | Penalty Amount | Year | City | Domain | 1_Pentalty Amount | 1_Year | 1_City | 1_Domain |
| B | 1000$ | 2015 | Barcelona | Medical | ||||
| A | 1250$ | 2016 | Tokyo | Chemical | 1250$ | 2003 | Rio de Janeiro | Chemical |
Best regards,
Nick

Comment