I am trying to import regression models from r to rmarkdown to produce tables of them with stargazer 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.
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: