I am interested in the ratio of random slope variance from a random slope and intercept model. I fit the model using lme4 as
model_slopes <- lme4::lmer(trait ~ covariate + (covariate | individual_ID), data = example_dataset) and calculate the ratio as :
$R_S^2$ = ${V_S \over V_p}$ = ${V_VV_X +\mu^2V_V\over V_F+V_I+V\phi+V_R}$
Where $V_S$ is the random slope variance that is calculated using
- $V_V$ - random-slope variance from the model
- $V_X$ - Variance in covariate from the raw data
- μ - Mean of covariate calculated from the raw data
- and $V_P$ is the total variance in response
I want to estimate uncertainity associated with $R_S^2$ using bootstrapping. My questions are these:
- What type of bootstrapping should I use - parametric? case?
- I have a repeated measure of 5 observation per individual. How can I do parametric bootstrapping keeping this data structure in mind?
- Since I use variance in covariate from the raw data, how can I estimate this for each bootstrap sample?
When I sample with replacement the individuals (non-parametric bootstrapping), I get a distribution of estimate which is not centered around the estimate from the model (little triangles). Here is an example where the yellow distribution is for $R_S^2$ and green one for $V_S$ for different values of repeated measures per individual from a simulation:
