I am currently doing difference in difference analysis in R and need to incorporate industry fixed effects. Overall, I can categorise my industries by factor(df$Industry) & levels(df$Industry) and then add them to my regression as a factor (industry). I have a data set where there are 70 different industries in one column. I want to combine these into 10 industries. Unfortunately I don't know the right code and everything I have tried doesn't work. I also know how to map the 70 to the 11 industries. I just don't have a function that allows me to refer to one column in the data set and then rename the other industries to the standard 10 industries. Does anyone know anything about this? That would help me a lot. Thank you very much in advance.
Asked
Active
Viewed 24 times
0
-
Welcome to SO BC31! Please see [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Dion Groothof Jan 13 '22 at 18:29
-
Please provide a complete example including description, input in reproducible manner so that anyone can copy and paste it into their session, expected output and best R code attempt. See top of [tag:r] tag page. – G. Grothendieck Jan 13 '22 at 18:29
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jan 22 '22 at 18:50