Nested Hierarchies? #66
Replies: 5 comments
-
|
Yes extra levels are a bit tricky. Handling one of the levels as fixed
effects makes it much easier, but I assume that's not desirable. What
exactly do you want to pool across - you want to allow every parameter to
vary across individuals and to have this pooled based on both study
specific population and overall (many studies) population? It might be
possible to make each parameter a sum of 2 parameters - one N(popmean,
popsd) and the other N(studymeandeviation, studysd) - and have the study
specific distribution parameters moderated by study dummy variables.
This would be interesting and nice to see, happy to provide some support
but you would also be diving in to the deeper waters with both ctsem and
random effects thinking! A sim study to verify the approach would be a good
start.
Can't really envisage the measurement model version but I might be
misunderstanding the problem.
…On Wed, May 14, 2025, 20:15 alexrand-gprl ***@***.***> wrote:
I'm working on a meta-analysis of studies in which each study has the same
single continuous outcome measurement of interest, measured over time for
each participant.
I've gotten my ctsem model fitting separately to each study-specific
dataset, with partial pooling across participants in that study. But I'd
like to fit one big model that also does partial pooling of study-specific
parameters across studies.
I'm new to ctsem but I haven't found any info on how/whether this might be
possible in the documentation. One idea I had was to treat each
participant's measurement as its own outcome variable, and fit the model as
a multi-measurement factor model. But this seems tricky because studies
vary greatly in their number of participants, with some having a few dozen,
and others having several thousand.
Any guidance appreciated!
—
Reply to this email directly, view it on GitHub
<#66>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7LCBORQFA7R4NORNBRFTL26OB5RAVCNFSM6AAAAAB5ECKH5CVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZYGMZDMMBQGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
yes, if you change the subject variable to a study variable then you've mashed all the individual time series together. Some kind of hack along those lines, where you make sure each subject is a long enough time after the previous subject so they begin from the stationary distribution, may well work, though is a bit on the ugly side! A nicer approach might be to fit the individual study models without priors, estimate the population distribution of the raw parameters using the distribution from each study (you'll find the samples under myfit$stanfit$rawposterior), then modify the priors to reflect this. This will only shrink estimates based on the variance of each parameter unfortunately -- it would be possible to modify the internals of ctsem to accomodate a multivariate prior, but this is not the standard setup. Perhaps there is a principled way to avoid the re-estimation and just shrink the obtained estimates to the empirical bayes estimates -- I kind of guess there is but don't know it off the top of my head. I'll have a little more time to think in a week or two. |
Beta Was this translation helpful? Give feedback.
-
|
Well, since I needed this for another work and it seemed much more interesting than what I otherwise had to do... here's an empirical bayes approach / test simulation. the blue estimates are without shrinkage across multiple studies, the eb (red) estimates consider the population of studies (ran with 20 studies here, only the drift parameter had variation, dotted black line represents approximate true value / mean). |
Beta Was this translation helpful? Give feedback.
-
|
Wow thanks Charles, this is super clear and helpful! I still have my heart set on full Bayes, and I'm curious about the possibility of modifying the ctsem-generated Stan code for the non-hierarchical version of the model to accommodate pooling across studies. In an ideal world this could even evolve into PR that would allow for this functionality in ctsem. It is a daunting idea but I have time and energy to devote to it. Do you have any advice on:
|
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry I ignored / missed this Alex! I came back here because someone else (José Ángel Martínez-Huertas) was asking me about the related issue of crossed random effects, perhaps you two would like to discuss it, I'm really happy to support in general. Basically, I just don't find full Bayes via Stan very feasible at present with ctsem. Making substantial changes to the code so that it's parallelisable within stan would be one place to start. Other things I can think of: using the empirical bayes estimates to set some kind of more sensible priors. using / improving the optimization then importance sampling approach already available within ctsem (this would give true Bayesian outcomes but with a linearized / integrated version of individual differences in parameters, not perfect for e.g. diffusion variance). discussing with another colleague the potential for some kind of autoencoder neural net setup for optimisation / sampling. wait and see if one of my students attempts to make it all work using Julia in the backend rather than stan pays off, might offer more flexibility for sampling setups etc. with the stan code, I would honestly start by stripping out all the stuff (at least within the core kalman filter section) that is not needed for a basic example -- it will be frustrating in the beginning but save you pain in the long run. From there you would need to restructure things so that the subject / id dependency is not univariate, and forward predictions are based off the correct prior state estimates. I guess I would love to see an approach using the kalman filter logic so it could be integrated easily in an optimisation framework too, because Bayes is just too slow for trying out many models etc I think. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a meta-analysis of studies in which each study has the same single continuous outcome measurement of interest, measured over time for each participant.
I've gotten my ctsem model fitting separately to each study-specific dataset, with partial pooling across participants in that study. But I'd like to fit one big model that also does partial pooling of study-specific parameters across studies.
I'm new to ctsem but I haven't found any info on how/whether this might be possible in the documentation. One idea I had was to treat each participant's measurement as its own outcome variable, and fit the model as a multi-measurement factor model. But this seems tricky because studies vary greatly in their number of participants, with some having a few dozen, and others having several thousand.
Any guidance appreciated!
Beta Was this translation helpful? Give feedback.
All reactions