0

I am using R on panel data to get a regression table. One of my control variables is not showing up in my regression table (namely: SPINDEX).

Does anyone know how to fix this?

 # Descriptives and tables

#descriptive 1
dfOnlyInteresting = select(df, "amountAquired", "NumberDirectors", "AnnualReportDate", "GenderRatio", "AGE", "roa", "xrd", "SPINDEX", "aquisitionFin", "aqusitionsNot0", "CEOTenure", "compRatio", "laggedAquisition", "amountAquired_mean")
stargazer(dfOnlyInteresting, type = "html", title="Descriptive statistics", digits=1, out="descriptives.doc")

# Create a panel dataframe
df.p = pdata.frame(df, index = c("GVKEY" ,"AnnualReportDate"))

# Test for duplicate row names
occur = data.frame(table(row.names(df.p)))
duplicateRowNames = occur[occur$Freq > 1,]

# Table 2
#----------------------------------------------------------
# Define models
#----------------------------------------------------------
mdlA <- amountAquired ~ GenderRatio + CEOTenure + AGE + roa + factor(SPINDEX) + aquisitionFin + xrd + laggedAquisition
mdlB <- amountAquired ~ GenderRatio + CEOTenure + AGE + roa + factor(SPINDEX) + aquisitionFin + xrd + laggedAquisition + compRatio
mdlC <- amountAquired ~ GenderRatio + CEOTenure + AGE + roa + factor(SPINDEX) + aquisitionFin + xrd + laggedAquisition + compRatio*NumberDirectors + compRatio

Thanks!

Phil
  • 7,287
  • 3
  • 36
  • 66
  • I think this might answer your question: https://stackoverflow.com/questions/67309639/why-am-i-losing-categorical-data-in-my-regression-summary – Jon Spring May 23 '22 at 21:20
  • 1
    If `SPINDEX` is a factor with only 2 or three levels, it could be predicted by knowing other discrete variables in the model. In such an instance, R will detect what are called "aliased" variables and omit them from the model. If that wasn't done, then the matrix algebra would fail. – IRTFM May 24 '22 at 03:29
  • @JonSpring that thread referred to one variable being dropped within a categorical variable (i.e.: for "colors" as a control variable, blue was dropped). But my control variable "SPINDEX" does not even show up in the regression table – Charlotte V May 24 '22 at 09:40
  • @IRTFM It has 9 levels so I am not sure why its being dropped – Charlotte V May 24 '22 at 09:40
  • 1
    This is difficult to answer without a reproducible example but to me this almost always happens because of collinearity which the other comments point to. Also, if you use factor() your output will, depending on the regression command/package your using, not return SPINDEX but its factor realization or something like as.factor(SPINDEX)Realization – Jakob May 24 '22 at 14:51
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Jakob May 24 '22 at 14:51
  • You can still experience multicollinearity with 9 levels. – IRTFM May 24 '22 at 20:17

0 Answers0