Time as a predictor

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
UmmAymanBarakah
Posts: 7
Joined: Sat Apr 05, 2025 9:06 pm

Time as a predictor

Post 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.
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Time as a predictor

Post 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?
UmmAymanBarakah
Posts: 7
Joined: Sat Apr 05, 2025 9:06 pm

Re: Time as a predictor

Post 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.
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: Time as a predictor

Post 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.
DavidAlexander
Posts: 1
Joined: Wed Apr 16, 2025 3:56 am

Re: Time as a predictor

Post 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).
Post Reply