Here is my data I'm working with on R. I'm trying to conduct a logistic GLM regression. enter image description here

I'm using this code:

h1 <- glm(pol_violence ~ defense + gdp + polityold + instabilityold + personalist + military_dic
          , data = dataset)

h2 <- glm(deliberal ~ defense +  gdp + polityold  + personalist   , family  = "binomial" ,  data = dataset)

But I get this:

               Estimate Std. Error z value Pr(>|z|)
(Intercept)   2.457e+01  1.883e+05       0        1
defense1     -4.913e+01  2.441e+05       0        1
gdp           6.142e-10  8.637e+01       0        1
polityold     9.579e-09  1.523e+04       0        1
personalist1  6.938e-07  1.911e+05       0        1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 7.6382e+00  on 5  degrees of freedom
Residual deviance: 2.5720e-10  on 1  degrees of freedom
  (16 observations deleted due to missingness)
AIC: 10

Number of Fisher Scoring iterations: 23

I dont understand why my model is unfit, or what I should do to fix the 0 in z value?

Help me please.

my dataset consists of 22 country observations with the years in which a military intervention occurred during a popular uprising. my hypotheses are H1: the stronger the military veto power during the uprising, the more likely there is political instability H2: the stronger the military veto power during the uprising, the more likely there is deliberalization

my independent variable military veto power is operationalized with the variable "defense" which expresses whether the defense minister is a military officer (then its coded as 1) if not, its coded 0.

my dependent variables are pol_violence which expresses instability. its coded 1 if there is political instability and 0 if there is non.

same goes to the other dependent variable deliberal which expresses deliberalization. 1 if there is deliberalization , 0 if there is non.

the other variables are control variables, 2 of them (personalist and military_dic) are binary and are coded 1 if there is a personalist leader or a military leader, 0 if non.

gdp is self explanatory. instabilityold expresses instability rate from the year before, the higher the number the more instability

polityold is the polity iv democracy rate from the year before, the higher the number the stronger the democracy.

the values 66 and 2 are missing variables

  • 1
    $\begingroup$ Could you explain a bit more your data? Why some variables only take the value 0, 1 or 66 for instance? $\endgroup$ Jun 14, 2020 at 10:31
  • 2
    $\begingroup$ Is it just a small sample of your data? Or is it all? In the latter case, I don't think you have enough data to perform such analysis ... $\endgroup$ Jun 14, 2020 at 10:40
  • 1
    $\begingroup$ Edit your question with more context about your data (sampling design, variables) and explain what are your questions and we'll try to find a solution. $\endgroup$ Jun 14, 2020 at 10:46
  • 1
    $\begingroup$ Where in the code do you replace your missings (66) by NA? $\endgroup$
    – Michael M
    Jun 14, 2020 at 10:53
  • 2
    $\begingroup$ Okay, makes sense. The problem now is that you lose 16 observations from your 22 due to missings. So you are only using 8 observations to test about 10(?) hypotheses, which simply is unrealistic. $\endgroup$
    – Michael M
    Jun 14, 2020 at 11:00

1 Answer 1


This is not a full fledged answer but rather extends two of my comments above.

I am afraid that what you have (data) is not sufficient to do what you want (test roughly a dozend hypotheses).

Things are additionally complicated by the presence of missing values: Your current implicit strategy is to remove all rows with any missing value, leaving you with just about eight observations to fit models with about five parameters. Even if all assumptions of GLMs are fullfilled, its p values rely on large sample theory and might be quite wrong for small samples.

The best we can do is:

  1. Add more countries, i.e. add more lines (if possible).

  2. Deal with missing values in the covariables. (Missing values in the response can't be fixed, so you can remove these rows for modeling.) A typical approach (e.g. offered by R package mice) is to fill missing values multiple times by "multiple imputation", yielding e.g. 100 slightly different but complete data sets. Then the GLMs are fitted on all 100 data sets and the results are combined to a final model with standard errors and p values corrected for the uncertainty from missing values. To be fit in multiple imputation is a great asset in general, especially when it is about hypothesis testing.

  3. Avoid highly influential observations by e.g. log transforming the very skewed GDP covariable.

  4. Call your p values "approximate".

  5. Specify your hypotheses before starting with the modeling process. Especially with such small data, it would be disastrous to generate the hypotheses on the fly, e.g. by doing manual or automatic covariable selection and then presenting only the results of the "optimized" model.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.