4
$\begingroup$

Ratgrp stands for lung function (FEV1/FVC)*100 and it has two categories:

  • 1: Lung function less than 70
  • 2: Lung function equal and higher than 70

smkgrp stands for smoking group and it is also categorically represented as:

  • 1: Nonsmokers
  • 2: Ex-smokers
  • 3: Smokers

Based on logit differences, how many odds ratios (ORs) you can compute for the interaction term ratgrp * smkgrp?

$\endgroup$
3
  • $\begingroup$ Categorization of lung function invalidates any analysis because of severe damage to your effective sample size. Similar comment for dose of cigarettes. $\endgroup$ Commented Mar 4 at 13:29
  • $\begingroup$ What does OR stand for? $\endgroup$ Commented Mar 4 at 13:40
  • $\begingroup$ @RichardHardy: Odds Ratio, will edit ... (For biostatisticians that will be as immediately recognizable as LS for many others) $\endgroup$ Commented Mar 4 at 14:14

2 Answers 2

4
$\begingroup$

Peter has a nice trick for estimating the number of coefficients for the interaction (+1). This can easily be checked in any regression software as well. As an example with some online data from UCLA and some R programming, here I manipulate the data to have three levels in one and two levels in another, ultimately creating two interaction coefficients such as yours would have.

#### Load Library and Data ####
library(tidyverse)
hdp <- read.csv("https://stats.idre.ucla.edu/stat/data/hdp.csv") %>% 
  as_tibble() %>% 
  mutate(CancerStage = factor(CancerStage)) %>% 
  filter(!CancerStage == "IV")
hdp 

#### Fit Model ####
fit <- glm(remission ~ CancerStage * Sex - 1,
           data = hdp,
           family = binomial)

#### Inspect ####
exp(coef(fit)) # exponentiate for OR

As shown below, where an OR is calculated for two interaction terms:

         CancerStageI          CancerStageII         CancerStageIII                Sexmale 
             0.6265823              0.4209431              0.3175231              0.9696970 
 CancerStageII:Sexmale CancerStageIII:Sexmale 
             1.1914599              0.9767356 
$\endgroup$
3
  • $\begingroup$ @ Shawn: Are you allowed to calculate the Odds Ratio for some combination of coefficients? e.g. Exp(Beta_5 + Beta_7)? $\endgroup$ Commented Mar 4 at 4:28
  • $\begingroup$ thanks ... do you think you can please post an explanation about this? I struggle with this point a lot, e.g. fit a simple logistic regression model to some data (with no interactions). does it make sense to calculate the odds ratio of multiple variables together and compare them to some reference level? Can you please post some math about this? I would really appreciate it... thank you so much! $\endgroup$ Commented Mar 4 at 7:37
  • $\begingroup$ Sorry ignore my previous comment, as I misread what you said (your original statement was correct). If you are trying to get the odds ratio of an event based off multiple predictors, you simply take the sum of the logit-scale coefficients (the original coefficients before transformation) and then transform them to probability or odds ratio after. An example is shown here on the probability scale, you would just use OR instead for your case. Note that my previous comment is still true about how you "toggle" these on/off, as shown in the answer. $\endgroup$ Commented Mar 4 at 8:06
4
$\begingroup$

Answer: 2 coefficients for the interaction can be calculated.

Explanation: If you have two categorical variables, one with $L_1$ levels and the other with $L_2$ levels, then you can calculate $(L_1 - 1)*(L_2-1)$ coefficients for the interaction.

$\endgroup$
3
  • 2
    $\begingroup$ I upvoted your answer but then realized the short answer isn't correct by this calculation. Since $L_1 = 2$ and $L_2 = 3$, wouldn't this mean it is $(2-1) * (3 - 1) = (1) * (2) = 2$? The estimated coefficients in R from my answer seem to reflect this, but I could be wrong. $\endgroup$ Commented Mar 4 at 3:31
  • 2
    $\begingroup$ @ShawnHemelstrand The question seems to have changed since I answered. I could have sworn each had two levels. Thanks for your edit $\endgroup$
    – Peter Flom
    Commented Mar 4 at 10:21
  • 1
    $\begingroup$ No worries. Glad we are on the same page in any case. $\endgroup$ Commented Mar 4 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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