I am working with a population of approximately 1 million subjects for whom I have repeated measures of expenditure (expend). My objective is to evaluate the link between 2 variables (let's say A and B) and the amount of expenditure. Given the longitudinal nature of the data and the presence of confounding factors, I cannot afford to estimate these associations directly. I therefore undertook to carry out mixed modelling using R and the lme4 library. Here is the code for the part that interests us.
glmer(expend ~ A*B + (1|ID), family = Gamma(link = "log"), data = data)
Given the population size, it is obviously not feasible to carry out this regression on all the data. Therefore, I undertook to iteratively repeat this regression model using random samples drawn from the population with replacement.
In the end, I have a sample of 5,000 models for which I obviously have estimators of the parameters and their variance.
Using only the distribution of the estimators obtained for the fixed effects allows me, I imagine, to estimate the standard error associated with them, but I'm more interested in estimating their distribution in the initial population and therefore obtaining their standard deviation in this population.
To do this I followed the procedure below with the following notations :
$ N $ number of samples / regressions
$ n_{Ai} $ number of observations with characteristic A in sample i and $ n_{\overline{A}i} $ the number of observations without characteritic A
$ \beta_{Ai} $ estimator of the parameter A of regression i
1 : Center the parameters obtained for regression : $ \beta_{Ai}' = \beta_{Ai} - \frac{\sum{\beta_{Ai}}}{n} $
2 : Multiply by the mean squared number of observation implied in each regression : $ \beta_{Ai}'' = \beta_{Ai}' \times \frac{\sum{(\sqrt{n_{Ai}}/2}+\sqrt{n_{\overline{A}i}}/2)}{n} $
3 : Recenter the parameters : $ \beta_{Ai}''' = \beta_{Ai}'' + \frac{\sum{\beta_{Ai}}}{n} $
4 : Estimate the standard deviation of the parameter in the population on the basis of the distribution of $\beta_{Ai}'''$
To test this approach, I carried out simulations using distributions with known parameters. It turns out that the variance obtained by the procedure I have just described always slightly overestimates the variance of the source distribution.
Any help you can give me to understand this problem better would be most welcome.