Hello,
I have a data-set for 68 different companies which has information of their price from 2014 to 2019.
I currently have:
-a variable corresponding to the date
-68 variables corresponding to each of the different companies.
What I need is to reshape the data so that I have an observation of the price for each date and a variable identifying each company.
I'm struggling to understand if I should use the command reshape from long to wide or from wide to long.
Alternatively, if I transposed the dataset I would have:
-a variable identifying each company with 68 observations
-one variable per-month from 2014 to 2019.
In this case I would need to generate a date variable and collapse all the existing date variables into a single variable that is sorted by date.
Thank you for your help
I have a data-set for 68 different companies which has information of their price from 2014 to 2019.
I currently have:
-a variable corresponding to the date
-68 variables corresponding to each of the different companies.
What I need is to reshape the data so that I have an observation of the price for each date and a variable identifying each company.
I'm struggling to understand if I should use the command reshape from long to wide or from wide to long.
Alternatively, if I transposed the dataset I would have:
-a variable identifying each company with 68 observations
-one variable per-month from 2014 to 2019.
In this case I would need to generate a date variable and collapse all the existing date variables into a single variable that is sorted by date.
Thank you for your help
Comment