Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Additive interaction with regression model, error after nlcom

    Hello Statalist users,

    I am writing in regards to problem I am dealing lately when determining an interaction between two exposure variables on an additive scale (I am using STATA 17 version).

    I would like to study the effects of two dichotome exposure variables on a continuous outcome using regression models adjusted for potential confounding factors. For RERI calculations, these two exposure variables were joint, and a joint variable is categorized with the protective category as reference category. When using nlcom command an error occurs, saying that expression evaluates to missing, r(498) (See at the end of message). The stata help function is not very descriptive for this error).

    Exposure variables:

    energy_ch – change in energy intake (calculated as difference between two timepoints T1-T0), dummy variable (0/1), where 0 – reduced energy intake of 600 kcal/day from baseline; 1 – not reduced
    pa_ch – change in physical activity (calculated as difference between two timepoints T1-T0), dummy variable (0/1), where 0 – engagement in physical activity 270 min/day; 1 – not accomplish
    energy_pa – joint variable with 4 categories:
    1. category: energy_ch 0; pa_ch 0 (YES reduced energy and YES accomplishing PA)
    2. category: energy_ch 0; pa_ch 1 (YES reduced energy and NO accomplishing PA)
    3. category: energy_ch 1; pa_ch 0 (NO reduced energy and YES accomplishing PA)
    4. category: energy_ch 1; pa_ch 1 (NOT reduced energy and NOT accomplishing PA)

    Outcome:
    fat_ch – change in body fat (calculated as difference between two timepoints T1-T0) and expressed in grams

    Covariables: sex, age

    Code:
    reg fat_ch i.energy_pa i.sexo age
    nlcom (RERI: exp(_b[4.energy_pa]+_b[3.energy_pa]+_b[2.energy_pa])-exp(_b[3.energy_pa])-exp(_b[2.energy_pa])+1)

    Stata output:
    expression (exp(_b[4.energy_pa]+_b[3.energy_pa]+_b[2.energy_pa])-exp(_b[3.energy_pa])-exp(_b[2.energy_pa])+1) evaluates to missing
    r(498);

    end of do-file

  • #2
    Probably one of the coefficients is huge and you are taking the exponent. If so, consider rescaling the corresponding variable.

    Code:
    display exp(1e+6)
    Res.:

    Code:
    . display exp(1e+6)
    .
    Last edited by Andrew Musau; 10 Jun 2023, 19:06.

    Comment

    Working...
    X