Announcement

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

  • Mixed-effects linear regression for food consumption and child growth in longitudinal data

    Hello, stata community. I would like your help once again,

    I am using mixed effects linear regression to evaluate food consumption as an exposure in the first years of life and child growth at age 5 as an outcome. In this example, I have as an exposure variable food consumption up to the first 3 months of life (cenario - variable with 3 categories) and as an outcome variable, repeated measurements of height for age (Variable z_altidade) in these children up to 5 years of age (however, the amount of measurements per child (id) varies (2-46 measurements). I want to know how food consumption in the first 3 months of life affects the time at 5 years. I used the following syntax:

    mixed z_altidade i.cenario c.idade_meses_en#c.idade_meses_en#c.idade_meses_en || id: idade_meses_en, cov(un)

    P.S.1: Also note that age is the variable that marks time (variable idade_meses_en).
    P.S.2: For age as a function of height/age, the cubic model was the best fit

    The question is: I'm not sure if I should add another interaction term referring to the cenario Variable with time

    Below is the baseline's model, as well as the regression output. I'm using Stata version 17

    Thank you for all your help

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long id byte sexo_ca float(cenario idade_meses_en z_altidade)
    10242453 0 1 1.8069816   .16006504
    10242453 0 1 2.7268994    .4580684
    10450108 1 2 1.8069816   -.8858762
    10450108 1 2 3.0554416  -1.1882422
    10450108 1 2 3.7125256   -.2099427
    10450108 1 2   6.40657   -.7585881
    10450108 1 2  8.279261    .1816332
    10450108 1 2   9.52772   -.4318246
    10450108 1 2 18.201231   -.8374036
    10450108 1 2 32.722794   -.3916168
    10450108 1 2  41.88912    .1921666
    10576959 0 1         0  -.07929426
    10576959 0 1   .952772    2.604984
    10576959 0 1  2.956879    .9491886
    10576959 0 1  5.749487    .8883988
    10576959 0 1  7.162218    .7397134
    10576959 0 1  10.38193    .6152673
    10576959 0 1 13.601643  -.08274923
    11055885 1 0  3.022587   .27920705
    11055885 1 0  4.106776    .5353787
    11055885 1 0  5.026694   .04612643
    11055885 1 0  6.012321   -.7585881
    11055885 1 0  6.866529    .6430932
    11532240 1 1 1.5112936    1.682775
    11532240 1 1 2.3326488   .28748262
    11532240 1 1  3.022587   .27920705
    11532240 1 1 4.6324434   1.0159707
    11532240 1 1  9.067762   1.3512913
    11532240 1 1 12.747434    2.209877
    11673070 1 0 .16427104   .06116878
    11673070 1 0 13.010267   1.2701492
    17647115 0 0  .3285421    2.604984
    17647115 0 0 1.5112936   2.1045804
    17647115 0 0   2.49692   2.4225495
    17650918 0 0  .3285421    .9944171
    17650918 0 0 18.299795   .10058954
    17658588 1 1  .3285421   -.4670638
    17658588 1 1 1.3470227   -.8858762
    27974818 1 0 1.0841889   -2.940797
    27974818 1 0 2.4640656   -1.712049
    27974818 1 0   4.36961  -1.3869892
    27974818 1 0  5.420945  -2.3218367
    27974818 1 0  7.030801   -.5363694
    29640336 1 2  11.07187  -.23131172
    29640336 1 2 17.511293    .6632237
    29640336 1 2  20.04107    .2844399
    29640336 1 2 27.597536   2.2812006
    29640336 1 2  31.04723   1.5428514
    29640336 1 2  32.29569   1.3168868
    31190159 1 0  3.811088   .27920705
    31190159 1 0  6.537988    .6430932
    31190159 1 0  7.819302  -.07576776
    31190159 1 0  8.870637   1.0884466
    31190159 1 0 14.160164    -.423727
    31190159 1 0 15.967146  -.05762093
    31190159 1 0 17.577002    .6632237
    31190159 1 0  22.07803 -.016256064
    32832552 0 0  .3285421  -.07929426
    32832552 0 0 1.0184804  -1.8867936
    32832552 0 0 2.2669406  -.03305185
    32832552 0 0 4.0410676  -2.3515866
    33695767 1 0  .3613963   .06116878
    33695767 1 0 1.2156057  -1.6564716
    33695767 1 0 2.0041068   -3.461639
    33695767 1 0  3.581109  -1.9219668
    33695767 1 0  9.724846   -.4318246
    33718216 0 0  1.577002   -1.375079
    33718216 0 0  3.482546   -.3814132
    34955417 0 0  .3613963    .9944171
    34955417 0 0 1.8069816    1.695209
    34955417 0 0  7.589323   1.1716125
    34955417 0 0 17.839836   .11547854
    36421115 0 0 1.4455853   .16006504
    36421115 0 0  3.088296   -.8564585
    36421115 0 0 10.644764   -.6005127
    36421115 0 0 13.404518   -.4630341
    37565537 1 1   3.12115   -.6990924
    37565537 1 1  6.702259   1.5775474
    39098684 1 1  1.281314   -4.481988
    39098684 1 1  2.858316   -4.711346
    39121618 1 0  2.529774   .28748262
    39121618 1 0  3.909651    .7683568
    39121618 1 0  5.749487   .51971906
    39121618 1 0  6.866529    .6430932
    39121618 1 0  8.279261  -.27177352
    39121618 1 0  9.199179   -.8776035
    39121618 1 0 10.414784    .3145875
    39121618 1 0 11.498974    .6273015
    39121618 1 0  12.41889    .5265452
    39223276 1 0   .952772   1.6458665
    39223276 1 0  2.792608   -.9622246
    40501789 1 2 1.4784395   -.8858762
    40501789 1 2  4.533881  -1.8675812
    40501789 1 2  5.388091   -2.795429
    40502209 1 0 3.5482545   3.2141056
    40502209 1 0 4.2710476   2.9383385
    40502209 1 0  5.223819   2.4140894
    40502209 1 0  9.002053    2.242849
    40502209 1 0 10.579056     .752242
    40502209 1 0 21.355236    .9968844
    end
    label values sexo_ca sexo
    label def sexo 0 "feminino", modify
    label def sexo 1 "masculino", modify
    label values cenario cenario
    label def cenario 0 "LM exclusivo", modify
    label def cenario 1 "Substitutos do leite materno", modify
    label def cenario 2 "IA precoce", modify
    ------------------ copy up to and including the previous line ------------------
    Click image for larger version

Name:	regression.png
Views:	1
Size:	112.4 KB
ID:	1730413

Working...
X