0

I am trying to look at the association between Income (high, upper-middle, lower-middle, and lower) and Edition (esci and sci). I have two questions:

  1. Can I do a chi-square even though this is not a 2x2 aka the predictor variable Income has 4 categories? If so, is this the correct code or do modifications need to be made to account for the non 2x2 format?

    chisq.test(data1$income, data1$edition)

  2. I had computed logistic regression models to look at the association between these variables and the odds ratio. Is this an appropriate statistical method, and if not, what would your recommend?

Thank you!

aml129
  • 25
  • 5
  • 1. Yes. 2. Odds ratios of what? (you don't seem to mention any non-categorical (numerical) data). – Alex Sep 26 '22 at 22:58
  • Would it be appropriate to have an OR for two categorical variables? Such as: the odds of having an esci edition amongst the lower-income group are 1.5x the odds of an esci edition amongst the (reference) high-income group? – aml129 Sep 26 '22 at 23:06
  • Yes, you can use `fisher.test(matrix(c(73, 43, 12, 83), nrow=2))`. It prints out the odds ratio automatically. But you need to be careful what to make the rows and what columns. – Alex Sep 26 '22 at 23:14
  • Oh I see. Is this code incorrect then? – aml129 Sep 26 '22 at 23:20
  • model5 <- glm(edition ~ Income, family = binomial(link="logit"), data = data1) betas.ORs.model5<- cbind(coef(model5), sqrt(diag(vcov(model5))), exp(cbind(coef(model5), confint.default(model5)))) colnames(betas.ORs.model5) <- c("Beta", "SE.beta", "OR", "95% LL", "95% UL") round(betas.ORs.model5, digits = 3) – aml129 Sep 26 '22 at 23:21
  • follow-up, in this case, is there any benefit to doing chi-square AND logistic regression? Or would a fisher test alone suffice? – aml129 Sep 26 '22 at 23:29
  • One uses logistic regression when the dependent variable is a binary categorical variable and the regressor is a [numeric](https://www150.statcan.gc.ca/n1/edu/power-pouvoir/ch8/5214817-eng.htm) (scaled) variable, while the chi-squared and Fisher's exact test are used when both the dependent variable and regressor are categorical. If your Income variable had been numerical (in USD or in EUR) then you might have thought about logistic regression. – Alex Sep 26 '22 at 23:47
  • Got it, thank you! I tried to do fisher.test but I think my data is too big. Is it possible to do chi square + odds ratio separately? oddsratio.wald(data1$Income, data1$Edition) – aml129 Sep 27 '22 at 05:10

0 Answers0