David Jones
2017-Mar-19 04:08 UTC
[R] Options for bootstrapped CIs for indirect effect: Nested data structure, missing data, and fully continuous X variable
I am looking for a package or other solution in R that can evaluate indirect effects and meets all of the following criteria: * Can create bootstrapped CIs around an indirect effect (or can implement any other method of creating asymmetric CIs) * Can address nested data (e.g., through multilevel/mixed effects) * Can allow for fully continuous X variables * Can address missing data (e.g., using multiple imputation via a package such as mice; I have a non-normally distributed mediator so cannot use ML for all estimation) Any input on what would address these criteria would be greatly appreciated. Here are the packages I have tried so far: * lavaan.survey - can do all of the above except for bootstrap estimation of the indirect effect (lavaan is great but cannot do multilevel, lavaan.survey is also great but cannot do the bootstrap estimate) * mediation - Has many strong features, but limits the X (treatment) variable to take 2 values at a time, whereas I have dozens of X values (from an observational study) * piecewiseSEM - Is very flexible and allows for multilevel data structure and multiple distributions, but does not have bootstrap/asymmetric CIs for indirect effects
Bert Gunter
2017-Mar-19 16:34 UTC
[R] Options for bootstrapped CIs for indirect effect: Nested data structure, missing data, and fully continuous X variable
Obviously question: Did you check the boot package ?? Also, try searching rseek.org. I suspect that in any case, you may have to do some customizing/programming, as you seem to have quite a few criteria. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Mar 18, 2017 at 9:08 PM, David Jones <david.tn.jones at gmail.com> wrote:> I am looking for a package or other solution in R that can evaluate > indirect effects and meets all of the following criteria: > > * Can create bootstrapped CIs around an indirect effect (or can > implement any other method of creating asymmetric CIs) > * Can address nested data (e.g., through multilevel/mixed effects) > * Can allow for fully continuous X variables > * Can address missing data (e.g., using multiple imputation via a > package such as mice; I have a non-normally distributed mediator so > cannot use ML for all estimation) > > Any input on what would address these criteria would be greatly appreciated. > > Here are the packages I have tried so far: > > * lavaan.survey - can do all of the above except for bootstrap > estimation of the indirect effect (lavaan is great but cannot do > multilevel, lavaan.survey is also great but cannot do the bootstrap > estimate) > * mediation - Has many strong features, but limits the X (treatment) > variable to take 2 values at a time, whereas I have dozens of X values > (from an observational study) > * piecewiseSEM - Is very flexible and allows for multilevel data > structure and multiple distributions, but does not have > bootstrap/asymmetric CIs for indirect effects > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Thierry Onkelinx
2017-Mar-20 07:55 UTC
[R] Options for bootstrapped CIs for indirect effect: Nested data structure, missing data, and fully continuous X variable
Dear David, Please have a look at our multimput package (https://github.com/inbo/multimput). It handles multiple imputation based on generalised linear mixed models. Currently based on either glmer (lme4) and inla (INLA) . After imputation you can apply any model or function you like. So you could use the boot package as Bert suggested. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2017-03-19 5:08 GMT+01:00 David Jones <david.tn.jones at gmail.com>:> I am looking for a package or other solution in R that can evaluate > indirect effects and meets all of the following criteria: > > * Can create bootstrapped CIs around an indirect effect (or can > implement any other method of creating asymmetric CIs) > * Can address nested data (e.g., through multilevel/mixed effects) > * Can allow for fully continuous X variables > * Can address missing data (e.g., using multiple imputation via a > package such as mice; I have a non-normally distributed mediator so > cannot use ML for all estimation) > > Any input on what would address these criteria would be greatly appreciated. > > Here are the packages I have tried so far: > > * lavaan.survey - can do all of the above except for bootstrap > estimation of the indirect effect (lavaan is great but cannot do > multilevel, lavaan.survey is also great but cannot do the bootstrap > estimate) > * mediation - Has many strong features, but limits the X (treatment) > variable to take 2 values at a time, whereas I have dozens of X values > (from an observational study) > * piecewiseSEM - Is very flexible and allows for multilevel data > structure and multiple distributions, but does not have > bootstrap/asymmetric CIs for indirect effects > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Bert Gunter
2017-Mar-20 14:47 UTC
[R] Options for bootstrapped CIs for indirect effect: Nested data structure, missing data, and fully continuous X variable
Private, because off topic. Thierry: I believe your advice is incorrect. The imputation and model fitting *must* be included as part of the bootstrap sampling -- that is, you must fit and multiple impute for each bootstrap sample as that mimics what you did with the original sample. Your procedure underestimates variability and so is likely to lead to irreproducible results. Of course, if I'm wrong, I would appreciate expanation and correction, but I would certainly understand if you have bigger fish to fry. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Mar 20, 2017 at 12:55 AM, Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote:> Dear David, > > Please have a look at our multimput package > (https://github.com/inbo/multimput). It handles multiple imputation > based on generalised linear mixed models. Currently based on either > glmer (lme4) and inla (INLA) . After imputation you can apply any > model or function you like. So you could use the boot package as Bert > suggested. > > Best regards, > > ir. Thierry Onkelinx > Instituut voor natuur- en bosonderzoek / Research Institute for Nature > and Forest > team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance > Kliniekstraat 25 > 1070 Anderlecht > Belgium > > To call in the statistician after the experiment is done may be no > more than asking him to perform a post-mortem examination: he may be > able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher > The plural of anecdote is not data. ~ Roger Brinner > The combination of some data and an aching desire for an answer does > not ensure that a reasonable answer can be extracted from a given body > of data. ~ John Tukey > > > 2017-03-19 5:08 GMT+01:00 David Jones <david.tn.jones at gmail.com>: >> I am looking for a package or other solution in R that can evaluate >> indirect effects and meets all of the following criteria: >> >> * Can create bootstrapped CIs around an indirect effect (or can >> implement any other method of creating asymmetric CIs) >> * Can address nested data (e.g., through multilevel/mixed effects) >> * Can allow for fully continuous X variables >> * Can address missing data (e.g., using multiple imputation via a >> package such as mice; I have a non-normally distributed mediator so >> cannot use ML for all estimation) >> >> Any input on what would address these criteria would be greatly appreciated. >> >> Here are the packages I have tried so far: >> >> * lavaan.survey - can do all of the above except for bootstrap >> estimation of the indirect effect (lavaan is great but cannot do >> multilevel, lavaan.survey is also great but cannot do the bootstrap >> estimate) >> * mediation - Has many strong features, but limits the X (treatment) >> variable to take 2 values at a time, whereas I have dozens of X values >> (from an observational study) >> * piecewiseSEM - Is very flexible and allows for multilevel data >> structure and multiple distributions, but does not have >> bootstrap/asymmetric CIs for indirect effects >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.