Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software 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!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
MossyMcCollie
Posts: 17
Joined: Tue Oct 16, 2018 1:24 pm

Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by MossyMcCollie »

I am trying to fit a model to a data set where data has been collected at 2 occasions; at baseline and follow-up. The outcome, a measure of child development, is numerical. The key predictor is a measure of use of technology by the child, also numerical. These variables are available both at baseline and follow-up. We also record some non-time dependent demographic variables on each child at baseline: gender, ethnicity etc.

Children are clustered within educational units. There are about 1500 children in the sample in total, and about 100 units (i.e. 15 children per unit on average)

There is some evidence that the relationship between technology use and child development is not linear. I don't know what it is exactly, but there appears to be one turning point (a maximum) in the curve, corresponding to an optimum amount of technology use for maximum value of the child development measure. As a first approximation, I might try a quadratic relationship.

I wonder if MLwiN can be used to model such data? The main question of interest is the relationship between technology use and child development; either using follow-up measures only, or, maybe, using change measures (follow-up minus baseline) for both variables. The change in both technology use and child development between baseline and follow-up is of secondary interest.

My assumption is that I can model this data set as a 3-level hierarchy; with repeated measures (level 1) nested within children (level 2) nested within educational units (level 3). The technology use variable would be at level 1; the demographics at level 2 (and some educational unit level variables at level 3). However I am not sure if 2 units is sufficient for a level based on replicate measures, and whether it is possible to model the non-linear relationship between technology use and child development.

I suppose that a sub-optimal solution might be to work with follow-up measures only (disregarding baseline) and just conceptualise the model as 2-level model: children within educational units. Then the technology use variable would be at the same level as the demographic variables.

Any advice on how to proceed would be very gratefully received.

Thanks
John
billb
Posts: 157
Joined: Fri May 21, 2010 1:21 pm

Re: Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by billb »

Hi John,
Presumably when you talk about a quadratic relationship you are talking globally as having only 2 measures per child would not allow anything more than a linear relationship at the child level. When someone uses terms like baseline and follow-up it suggests something happens in between though you don't explicitly say what? In such cases one would generally go 2 levels with anything at baseline as a predictor for the response at follow up or alternatively take differences to show the change in development score. Don't know if that helps?
Best wishes,
Bill.
MossyMcCollie
Posts: 17
Joined: Tue Oct 16, 2018 1:24 pm

Re: Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by MossyMcCollie »

Hi Bill
We believe the relationship between use of technology and child development score to be non-linear; at both time points. The first set of measures are taken when the children are about 4 years old. It appears that up to a point, more technology use is associated with better developmental scores, but (just like our parents told us), too much screen time is not good for you: developmental scores reach a peak with certain levels of technology usage, but then start dropping.

The same effect (or almost the same) is observed at the 2nd time point, at age 5 years: we see maximum levels of development at a certain level of technology use. In both cases the relationships look like they might be approximated with a quadratic fit, although almost certainly not exactly the same quadratic curve.

The time-related changes are of secondary interest, and we don't postulate any non-linear relationship of the outcome with time (as you point out, we can't do that anyway with only 2 measure per child). I could run a 2-level model (children within schools) at 4 years of age; and another 2-level model at 5 years of age. In both cases tech use would be a level-1 variable, and I assume that the best way of dealing with the quadratic nature of the data would be to include a "tech use squared" term in a linear model. I could then make some simple comparative analyses comparing, say, mean tech use at age 4 with mean tech use at age 5.

The alternative, as far as I can see, is a 3-level model, as specified below - i.e. replicate measures within children within educational units. I have run models of this kind previously; but never when I have had as few as 2 replicate measurements per individual as my level-1 data.

I hope this makes sense! I think after these further reflections what I am really wondering is whether I should be running a 2-level or 3-level model on this data.

Thanks for any insight you can offer.
John
billb
Posts: 157
Joined: Fri May 21, 2010 1:21 pm

Re: Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by billb »

Hi John,
Thanks for the clarification. I'd therefore call the measures age 4 and age 5 rather than baseline and follow up. Then 3-levels might make more sense and you could include age as a predictor to control for age related differences perhaps with age related interactions which would pretty much bring you back to the 2 2 level models you mention and tech use squared indeed gives a quadratic. I still think the challenge is your design is observational rather than experimental i.e. you don't know whether the technology use causes the developmental score or vice versa - clearly if you could control one (technology use) and measure the other you would have a much stronger design. It is also hard to know what individual differences there may be i.e. maybe if the relationship is truly (quadratic) which I see would make sense - more technology improves things but at some point the child spends too much time on technology to focus on their development - then this sweet spot might vary from child to child and might be age dependent but you only have 2 time points per child.
Good luck and best wishes,
Bill.
MossyMcCollie
Posts: 17
Joined: Tue Oct 16, 2018 1:24 pm

Re: Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by MossyMcCollie »

Thanks Bill. You make 2 very good points there. The possible reversal of association is something we will have to think carefully about - it hadn't occurred to me, but now you point it out, it seems obvious! I also had some concerns about the analysis being limited to 2 time points and the age dependency issue.

Thanks again for extremely helpful and insightful comments.
John
tonyadams
Posts: 6
Joined: Fri Jun 16, 2023 9:24 am

Re: Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by tonyadams »

Hi John,build now gg
MLwiN can handle polynomial terms, so you can include quadratic terms to account for the potential non-linear relationship between technology use and child development. You would specify these terms in your model equation.
hanajijang
Posts: 1
Joined: Wed Jan 03, 2024 9:15 am

Re: Non-linear repeated measures 3-level (Or maybe 2-level!) modelling

Post by hanajijang »

Based on the complexity of the data and the nature of the relationships you want to explore, it appears that a mixed-effects modeling approach, such as multilevel modeling (MLM), may be appropriate. fit. MLM allows you to take into account the hierarchical structure of the data, where repeated measures are nested within children and children are nested within educational units.

Here are some steps you can consider:

Prepare data:
Make sure your data is structured properly with variables at the correct level.
Create measures of change (follow-up minus baseline) for both technology use and child development variables if you are interested in examining changes.

Model Specification:
Since you are interested in a potential quadratic relationship, consider including quadratic terms for the technology use variable in your model.
Specify random effects at each level to capture variation within and between children and educational units.

Software selection:
While MLwiN can handle multilevel modeling, you might also consider using specialized statistical software such as R (using packages like lme4 or nlme), Python (using statistical models), or specialized software such as HLM (Hierarchical Linear Model).

Model fit and diagnosis:
Evaluate model fit using appropriate fit indices.
Check normality of residuals and other assumptions.

Interpretation:
Interpret fixed effects to understand the relationship between predictors and outcomes.
Test for random effects to understand variation at different levels.basket random

Because you have a relatively small number of units (educational units), you may have difficulty estimating more complex models. It's important to be cautious about overfitting, and you may need to simplify your model if necessary.
Keep in mind that this approach may need adjustment based on the characteristics of your data and the specific questions you are trying to answer. Consulting with a statistician or data analyst experienced in multilevel modeling can be valuable in tailoring an approach to your specific needs.
Post Reply