4

I tried to use the omit and the omit.yes.no options in stargazer() to omit a dummy variable. It seems that there is a bug involving this option. These are what I expect get from the output from stargazer.

                             logit_1       logit_2    logit_3

| covariates 1            |     21***   20 ***    21.4***
                             (0.2)     (0.12)    (0.10)

| covariate 2             |     0.5     0.3***     0.31***
                              (0.4)    (0.13)      (0.15)

| factor(covariate 3) A   |             0.123***   0.3***
                                        (0.06)     (0.08)

| factor(covariate 3) B   |             1.5**       1.03***
                                        (O.78)     (0.073)

|       OM                |    No         No        Yes

My stargazer command is the following;

stargazer (logit_1,logit_2,logit_3, omit='OM', omit.labels="OM", omit.yes.no = c("Yes","No")).

When I run the previous command the results of the OM variable is No Yes Yes.

When I run

stargazer (logit_1,logit_2, omit='OM', omit.labels="OM", omit.yes.no = c("Yes","No"))

I get No No.

And when I run

stargazer (logit_2,logit_3, omit='OM', omit.labels="OM", omit.yes.no = c("Yes","No"))

I get Yes Yes.

TigerhawkT3
  • 48,464
  • 6
  • 60
  • 97
DJJ
  • 2,481
  • 2
  • 28
  • 53

1 Answers1

5

Yes, this is a known bug that will be removed in the next release. For now, you can apply the following fix:

On line 3956 of stargazer-internal.R, please replace:

if (!is.na(.global.coefficients[k,i])) {

by the following:

if (!is.na(.global.coefficients[.global.coefficient.variables[k],i]))

Then, install again from source. You can also e-mail the package's author for a working version of stargazer that corrects this issue.

  • Thanks for pointing out the answer. Would it be possible to point out some references how to modify the file? – DJJ Mar 21 '14 at 08:34
  • The source code is available on CRAN. Modify the code and install from CRAN. –  Mar 21 '14 at 09:47
  • @Marek, what does next release mean? To me it seems that the current version 5.1 was released on May 29, 2014 - nine days after this post. Can we assume that the bug is fixed? – MERose May 05 '15 at 09:45
  • Yes, bug fixed. See ChangeLog for each package release. –  Jul 09 '15 at 00:13