0

I am trying to import regression models from to to produce tables of them with in a pdf file. The problem is that I cannot rename the covariates so that the table is presentable. The problem is that when I try to rename the covariates manually, the names and values when I knit the file are all different than they should be. Between the covariates there are multi-level factors (Employment, Sect and education) which I believe are causing the problem. So how can I rename all these covariates (including factor levels) to make the table look good?

If I print the regression table without renaming the covariates, the data are correct. enter image description here

Then I enter the code to rename the covariates

stargazer(Model1A, Model1B, Model2A, Model2B, Model3A, Model3B,
          title='My Regression Table',
          order=c("Eco_diff", "Employment", "Pol_Interest", "Reform", "Redistribution", "Trust_Instit", "Voters", "Gov_satisf", "Gov_respons", "infl_gov", "Economy", "Redistribution_past", "Religious", "Corr_national", "Corr_local", "Sect", "Male", "Edu", "Age", "Urban", "Internet_user"),
          covariate.labels = c("Economic difficulties", "Employment Status", "Political Interest", "Implementing reforms", "Redistribution nowadays", "Trust in Institutions", "Voters", "Gov. Satisfaction", "Gov. responsivness to people", "Capacity to influence the Gov.", "Rating Economy", "Redistribution compare to the past", "Religiousness", "Perception of national institutions corruption", "Perception of local institutions corruption", "Sect", "Male", "Education", "Age", "Urban", "Heavy internet user"),
          font.size="tiny", report="vc*s", nobs=TRUE, no.space=TRUE,
          digits.extra=1, digits=2,
          dep.var.labels="Predictors of double participation in the Lebanese October Revolution",
          omit.stat=c("f","ser","rsq"),
          style="apsr",
          star.cutoffs=c(0.05,0.01,0.001),
          notes.append=FALSE, notes.align="l",
          notes.label="",
          notes=c("\\emph{Source}: The Data Frame, 2021-2022.",
                  "\\emph{Note}: Multivariate linear regression.",
                  "$^{*}$p$<$0.05; $^{**}$p$<$0.01; $^{***}$p$<$0.001"))

And the result is this:

enter image description here

Enosky
  • 11
  • 3
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Maybe make a smaller model that minimally reproduces the problem in the question. – MrFlick Jun 21 '23 at 14:44

0 Answers0