1

I have data from the WIND terminal with the data structured in rows (even time series information)

For example:

Ticker Company Name NetProfitGrowth2009 NetProfitGrowth2010

I believe in order to estimate a time series regression I need to transform the data into the panel data so that its structure is

Ticker Company Year Net Profit Growth (so that for example for 15 years 15 different rows correspond to the same company)

How do I do it quickly since doing it like transposing and pasting/copying would take hours given that I have 347 companies and 15 years? The data is in Excel. What would be your suggestions?

1
  • Welcome to StackOverflow! Are you familiar with R? A famous group of package ( grouped in tidyverse) include the package readxl and the function read_excel() . Also, pivot_longer() from the pacakge tidyr is meant to use the year (ex. in NetProfitGrowth as a value of a variable year. I don't know about WIND. Commented May 21, 2024 at 13:35

2 Answers 2

1

In Stata, this calls for reshape long, perhaps

reshape long NetProfitGrowth, i(Ticker Company) j(Year)
Sign up to request clarification or add additional context in comments.

Comments

1

In R you can use this:

library(tidyr)
library(dplyr)
your_data_frame %>% 
  pivot_longer(NetProfitGrowth2009:NetProfitGrowth2010, names_to = "Year", values_to = "Profit_Growth") %>% 
  mutate(Year = sub("\\D+", "", Year) %>% as.integer)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.