logistic regression model pairwise comparisons

565 Views Asked by At

I want to compute a model that checks on differences between Statuses between data sets plotted here on the graph:

1: https://i.stack.imgur.com/k7iBD.png StatusesbetweenDatasets

Therefore I computed the following model:

model <- glm(Nutritional.Status ~ Data.origin, family = 'binomial'(link='logit'), data = data)
summary(model)

I got the output:

> model <- glm(Nutritional.Status ~ Data.origin, family = 'binomial', data = data)
> summary(model)

Call:
glm(formula = Nutritional.Status ~ Data.origin, family = "binomial", 
    data = data)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.9667  -0.9469  -0.9469   1.4269   1.4269  

Coefficients:
                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)          -0.08701    0.41742  -0.208 0.834879    
Data.originIR.recent  1.86478    0.52121   3.578 0.000347 ***
Data.originUK        -0.48261    0.43043  -1.121 0.262185    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 686.54  on 498  degrees of freedom
Residual deviance: 614.61  on 496  degrees of freedom
  (428 observations deleted due to missingness)
AIC: 620.61

Number of Fisher Scoring iterations: 4

I would like to see pairwise comparisons though, my question is, are there significantly more good status in 1 data set in comparison to the others etc.

I tried lsmeans and emms but the output is not what I am looking for im afraid:

pigs.emm.s <- emmeans(model, "Nutritional.Status")
> pairs(pigs.emm.s)
 contrast                    estimate    SE  df z.ratio p.value
 Good - Moderate               -0.489 0.587 Inf  -0.834  0.6818
 Good - (Poor-very poor)        0.785 0.494 Inf   1.588  0.2510
 Moderate - (Poor-very poor)    1.274 0.644 Inf   1.980  0.1172

Results are given on the log odds ratio (not the response) scale. 
P value adjustment: tukey method for comparing a family of 3 estimates 

Any advise on how to get to my answer? Or is my first model output enough to state that the statuscomposition between the sets is significantly different and therefore significantly more good statuses are in 1 data set in comparison to the other?

Thanks a million!

0

There are 0 best solutions below