Page 1 of 1
Time as a predictor
Posted: Sun Apr 06, 2025 7:39 pm
by UmmAymanBarakah
Hello,
In all my stata analyses, time serves as a control variable. Now that I am using runmlwin, and after going through the courses in LEMMA I am confused whether to use time as a level 2 classification. Thus, my level 1 is facility, level 2 time, level 3 ParentFirm.
or should I add time as a covariate. If so, how do I add it as a categorical predictor.
Re: Time as a predictor
Posted: Mon Apr 07, 2025 9:09 am
by ChrisCharlton
Could you provide any further information about what your
time variable represents? E.g., Is it the occasion on which a measurement was taken, as in the example in chapter 13 of the MLwiN manual (
https://www.bristol.ac.uk/cmm/media/sof ... al-web.pdf), or is it a continuous measurement? If it is categorical, how many unique values can it take in your data? What purpose are you hoping to use it for in your analysis?
Re: Time as a predictor
Posted: Mon Apr 07, 2025 3:44 pm
by UmmAymanBarakah
The best way to put this is that my data is a longitudinal data. So I am dealing with firms. Therefore, I am looking at the firms operating in 2015, 2016, 2017, 2018, 2019, 2020..... I have 10 time periods. I am controlling for the time. In stata's gsem, I realised that whether I contorlloed for the time (with i.time) like a categorical variable or I made it a level 2 classification, the result was not very different.
Re: Time as a predictor
Posted: Tue Apr 08, 2025 10:54 am
by ChrisCharlton
These two approaches should also work with runmlwin, so it is probably worth trying both ways and then comparing with the results that you had previously from gsem.
Re: Time as a predictor
Posted: Wed Apr 16, 2025 4:03 am
by DavidAlexander
UmmAymanBarakah wrote: Mon Apr 07, 2025 3:44 pm
The best way to put this is that my data is a longitudinal data. So I am dealing with firms. Therefore, I am looking at the firms operating in 2015, 2016, 2017, 2018, 2019, 2020..... I have 10 time periods. I am controlling for the time. In stata's gsem, I realised that whether I contorlloed for the time (with i.time) like a categorical variable or I made it a level 2 classification, the result was not very different.
Stata's gsem treats things differently under the hood than runmlwin. So even when you treat time as a level, you’re not getting much added value unless you’re modeling random slopes or variance components at the time level (which is uncommon unless you're analyzing time itself as a source of random variation, like in educational data with testing years).