Hey everyone,
I am trying to add SIC2 sectors and years into my regression, but am not sure if my current method is correct. I made dummy variables for both as follows:
dummyFyear <- reorder(Thesis2$fyear , Thesis2$gdwlia ,FUN=mean)
dummyindustry <- reorder(Thesis2$sic2,Thesis2$gdwlia, FUN =mean)
My question,
Can I add these dummy variables into my regression or do I need to treat them differently?
Thank you in advance!
For reproducing:
gvkey <- c(1, 1, 1, 1, 2,2,2, 4, 4 )
fyear <- c(2005,2006,2007,2008, 2007,2008,2009 , 2005,2006)
sic2 <- c("10-14", "10-14", "10-14", "10-14", "15-17","15-17","15-17", "90-98", "90-98" )
gdwlia <- c(-50 ,-65 ,1 ,-100 ,-200 ,-250 ,-32 ,-40, -8)
cashflow <- c(100, 110, 120, 130, 500, 550, 600, 50, 60)
lagAT <- c(1000,1500,1300,1200, 300,500, 800, 70, 40)dummyFyear <- reorder(reprex$fyear , reprex$gdwlia ,FUN=mean)
dummyindustry <- reorder(reprex$sic2,reprex$gdwlia, FUN =mean)reprex <- data.frame(gvkey, fyear, sic2, gdwlia, cashflow, lagAT)
model <- gdwlia ~ cashflow +lagAT + dummyFyear + dummyindustry
resultatenmodel <-lm(model, data=reprex)
summary(resultatenmodel)
Yours sincerely,