0
votes

I am running a logistic regression and reporting the results with stargazer. I've noticed that when I apply the apply.coef = OR option (so that the odds ratios would be reported), the significance stars are reported wrongly - in some cases there is no stars instead of three, sometimes there are stars when there shouldn't be. For example;

stargazer(basic.logit.model, 
      type="html",
      apply.coef = OR,
      column.labels = c("Base"),
      dep.var.labels.include = FALSE,
      digits=2, out=("basic_model_only.htm"))

yields

X   0.33
(0.23)
Constant    0.03
(0.11)
Observations    6,532
Log Likelihood  -552.64
Akaike Inf. Crit.   1,109.28
Note:   *p<0.1; **p<0.05; ***p<0.01

and without the apply-coef option, the results are:

X  -1.10***
(0.23)
Constant    -3.68***
(0.11)
Observations    6,532
Log Likelihood  -552.64
Akaike Inf. Crit.   1,109.28
Note:   *p<0.1; **p<0.05; ***p<0.01

what am I missing?

2

2 Answers

1
votes

generally you should strive to provide a minimal working example so we can reproduce your results - in this case it would be great to have data and the code you use to produce your basic.logit.model.

To your question, apply.coef only transforms your coefficients but not the standard errors as your results show. stargazer calculates the significance level using these untransformed SEs which results in non-significant coefficients.

To avoid this, provide stargazer with the custom p-values (those from the original model) using the p argument.

This should work for you

p.values <- list(summary(basic.logit.model)$coefficients[,4]

stargazer(basic.logit.model, 
  type="html",
  apply.coef = OR,
  p = p.values,
  column.labels = c("Base"),
  dep.var.labels.include = FALSE,
  digits=2, out=("basic_model_only.htm"))
0
votes

In the above case, the t-stats would also be wrong:

Instead, it is much simpler to stargazer not to recalculate the t-stats and p-values as follows:

stargazer(basic.logit.model, apply.coef = exp, t.auto=F, p.auto=F)

Also, note that your Std Errors and Confidence Intervals will be wrong unless you adjust.

For CIs, its pretty simple:

stargazer(basic.logit.model, apply.coef = exp, apply.ci = exp, t.auto=F, p.auto=F, ci = T)

If you want to report Std Errors, you cannot use the apply.se = exp option.

See the following post for how to do it: Odds ratios instead of logits in stargazer() LaTeX output