Announcement

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

  • How to handle time?

    Suppose this is 7 years of observational data of 70 fruits trees at 23 different sites
    where "n_obs" is the number of fruits on a limb of a tree and "n_inf" is the number
    of infected fruits.

    The aim is to assess the impact of the max temperature-humidity index during a growing
    season (thi) measured over seven growing seasons (time)

    The data is hierarchical, with site at the top level, tree nested in site and
    individual observations of fruit at the bottom level.

    This is aggregated binary data (infected or not infected (0/1).

    Additionally, the data is longitudinal, with observations on the same trees being
    repeated each year (or growing season; "time").

    While this data is not real, the real data has a lot of missing outcome data (n_inf),
    in that follow-up time for trees varied. Some trees contributed one timepoint, others
    a five-year interval, others just the first two years and the last two year.

    Clearly there is a hierarchical structure, which is straightforward to specify:

    meglm n_inf thi || site: || tree: , family(binomial n_obs) link(logit)

    (1) Could this model sufficiently deal with time, by specifying the random effect for tree?

    (2) We are not interested in comparing the proportion infected fruits between years,
    arguing that time should not be treated as a fixed effect. But is this contradicted
    by the idea that it is of interest to average results over the seven years?

    (3) Separately, what kind of argument would support treating time as a random effect?

    (4) Finally, does the complicated missing outcome data described above impact (1) - (3)?

    Any papers on a similar subject would be greatly appreciated. Thanks!

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float site long tree float(time thi) double n_inf long n_obs float(log_thi prop_inf)
    59 90043 5 66.41 0 15 4.1958475 0
    70 90054 6 65.57 0 16 4.1831183 0
    47 50666 4 71.72 0 20 4.2727695 0
    80 52166 4 66.31 0 30 4.1943407 0
    74 52455 6 68.28 0 16  4.223617 0
    81 52783 3 70.47 0 15  4.255187 0
    80 52247 7 71.58 0 32  4.270816 0
    22 50998 2  65.1 0 30 4.1759243 0
    40 90041 3 67.55 0 15  4.212868 0
    77 52295 3 67.04 0 15 4.2052894 0
    74 52843 3 69.89 0 15 4.2469225 0
    87 90012 7 70.81 0 15      4.26 0
    87 90012 6 68.22 0 15  4.222738 0
    40 50509 6 71.28 0 16  4.266616 0
     1 90049 2 60.99 0 30   4.11071 0
    80 52115 1 64.24 0 30 4.1626263 0
    47 50665 7 68.86 0 15 4.2320757 0
    79 52330 5 67.04 0 15 4.2052894 0
    74 52414 6 65.66 0 15   4.18449 0
    87 90018 6 71.98 0 16  4.276388 0
    74 52462 2 64.68 0 15  4.169452 0
    71 52815 4 71.63 0 21  4.271514 0
    80 52702 4 62.61 0 62  4.136925 0
    87 90018 4 70.81 0 15      4.26 0
    22 50985 7 63.64 0 31  4.153242 0
    74 52399 5 70.21 0 31 4.2514906 0
    70 52810 7 67.88 0 22 4.2177415 0
    74 52146 1 70.45 0 16 4.2549033 0
    59 90043 7 61.42 0 15 4.1177354 0
    59 90047 3 65.57 0 16 4.1831183 0
    81 52783 7 71.04 0 15  4.263243 0
    70 90055 7 68.32 0 15 4.2242026 0
    74 52408 2 68.35 0 31 4.2246413 0
    74 52732 3 70.78 0 14 4.2595763 0
    70 52810 4 62.61 0 27  4.136925 0
    22 50998 4 69.37 0 30 4.2394547 0
    40 50502 5 72.03 0 16  4.277083 0
    20 50761 7 68.19 0 16  4.222298 0
    22 50985 6 70.95 0 17 4.2619753 0
    85 90022 1 71.49 0 16 4.2695575 0
    80 52749 4 63.51 0 30 4.1511974 0
    75 52366 1 66.05 0 15  4.190412 0
    74 52415 2  68.5 0 16  4.226834 0
    47 50666 3 69.12 0 15  4.235844 0
    87 90018 3 63.13 0 15  4.145196 0
    79 52251 1 69.99 0 15 4.2483525 0
    12 90042 4 72.22 0 15  4.279717 0
    40 50505 2 64.61 0 15 4.1683693 0
    74 52427 5 67.66 0 15  4.214495 0
    80 52382 3 69.83 0 32 4.2460637 0
    59 90047 2 68.21 0 15 4.2225914 0
    47 50874 4 68.05 0 29  4.220243 0
    80 52346 7 69.67 0 62 4.2437696 0
    79 52251 2 67.48 0 15  4.211831 0
    74 52438 1 68.28 0 16  4.223617 0
    12 90042 7 71.01 0 16 4.2628207 0
    87 90018 5 66.75 0 15 4.2009544 0
    62 90059 7 66.66 0 14  4.199605 0
    80 52342 3 65.62 0 62  4.183881 0
    69 52368 1 66.03 0 12 4.1901093 0
    74 52438 3  63.3 0 15 4.1478853 0
    80 52333 3 66.29 0 30  4.194039 0
    62 90059 2 60.02 0 15  4.094678 0
    47 50666 6 64.89 0 15 4.1726937 0
    59 90047 6 64.43 0 15 4.1655793 0
    79 52330 4 68.09 0 16 4.2208304 0
    80 52702 6 72.13 0 62   4.27847 0
    59 90048 2 64.64 0 16 4.1688333 0
    70 90057 3 65.86 0 15 4.1875315 0
    80 52332 1  65.4 0 62 4.1805224 0
    76 52483 6 62.39 0 31  4.133405 0
    70 90055 4 65.57 0 16 4.1831183 0
    40 50502 2 71.22 0 14  4.265774 0
    40 90041 7 64.54 0 16  4.167285 0
    74 52732 1 71.09 0 15 4.2639465 0
    59 90043 2 64.36 0 15  4.164492 0
    80 52749 7 68.33 0 30  4.224349 0
    47 50874 7  68.5 0 31  4.226834 0
    76 52483 3 62.28 0 30 4.1316404 0
    69 52368 3 65.97 0 14    4.1892 0
    59 90047 7 65.77 0 16  4.186164 0
    40 50509 5 64.57 0 17   4.16775 0
    74 52415 5 70.57 0 14  4.256605 0
    70 90055 1 65.78 0 15  4.186316 0
    59 90048 5 62.16 0 15 4.1297116 0
    79 52437 3 68.81 0 14  4.231349 0
    79 52437 7  67.4 0 15  4.210645 0
    80 52166 2 68.68 0 28  4.229458 0
    74 52411 6 63.98 0 15 4.1585703 0
    74 52438 4  65.4 0 15 4.1805224 0
    80 52247 4 64.43 0 30 4.1655793 0
    40 50502 1 68.53 0 16 4.2272716 0
    70 90057 7 59.25 0 15 4.0817657 0
    80 52115 4 70.76 0 30  4.259294 0
    79 52330 2  72.5 0 14 4.2835865 0
    80 52333 5 70.67 0 28 4.2580214 0
    10 90051 6 71.89 0 15  4.275137 0
    74 52415 7 69.89 0 15 4.2469225 0
    70 90054 1 62.34 0 16  4.132603 0
    79 52251 7 68.11 0 14  4.221124 0
    end

  • #2
    Originally posted by Janine Stubbs View Post
    (1) Could this model sufficiently deal with time, by specifying the random effect for tree?
    Most mixed models that I've seen of longitudinal studies will include time in at least the fixed effects equation. (Actually, I can't offhand recall an exception.)

    (2) We are not interested in comparing the proportion infected fruits between years,
    arguing that time should not be treated as a fixed effect. But is this contradicted
    by the idea that it is of interest to average results over the seven years?
    Wouldn't including time (growing season) as a fixed effect help "to assess the impact of the max temperature-humidity index during a growing season"? That is, including time alongside thi would help clarify that which is due to whatever the latter measures from other factors that might have contributed to fruit infection during the same growing season.

    (3) Separately, what kind of argument would support treating time as a random effect?
    If you believe that there is an interaction of orchard (or tree) and time, then including a random slope for time at the level of orchard (or tree) should improve the representativeness of the model. I wouldn't expect much change in a mature orchard over seven years, but if your study includes a mix of very young orchards with mature (or senescent) orchards and if fruit infection rate varies with orchard age, then perhaps.

    (4) Finally, does the complicated missing outcome data described above impact (1) - (3)?
    I'd be more worried about the mechanism of missingness (whether ignorable) and its extent than its temporal pattern.

    Comment

    Working...
    X