Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confidence intervals for getEff() functions #52

Open
mvedrin opened this issue Aug 11, 2023 · 3 comments
Open

confidence intervals for getEff() functions #52

mvedrin opened this issue Aug 11, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@mvedrin
Copy link

mvedrin commented Aug 11, 2023

Hi,

I am wondering if there is some way to output the confidence intervals along with the reported getEff() functions?

One of the issues I'm running into is that I have some pathways that flow through multiple predictors and while the getAllInd() function does provide me with the effect estimates, I want to check the confidence intervals, as well.

The summary(semEff(sem.Eff.boot)) does output confidence intervals, but I am unable to get some of the paths through and around multiple mediators to show with the summary output.

For example, in my model I have the following paths that I want the direct/indirect effects and confidence intervals for:
Daycount_poly1 --> turb_pre_ln1 --> nitrite_pre_ln --> cl2_tot_pre
Daycount_poly1 --> turb_pre_ln1 --> cl2_tot_pre
^Note: not the "total" indirect path through turb_pre_ln1, but the path that passes through turb_pre_ln1 and not nitrite_pre_ln

Daycount_poly1 --> temp_pre_ln --> nitrite_pre_ln --> cl2_tot_pre
Daycount_poly1 --> temp_pre_ln --> cl2_tot_pre
^Note: not the "total" indirect path through temp_pre_ln, but the path that passes through temp_pre_ln and not nitrite_pre_ln

Daycount_poly1 --> nitrite_pre_ln --> cl2_tot_pre
^Note: the path through nitrite_pre_ln1 that does not first go through turb_pre_ln1 or through temp_pre_ln

Here is the output from my getAllInd(sem.Eff.boot) that I want to have confidence intervals for each effect reported:
image

I tried to dive into the sem.eff object to extract values myself but couldn't find them all.

Thanks for any help!

@murphymv
Copy link
Owner

HI,

This functionality will be included in the next release, currently via a exclude.other.med argument to semEff() - allowing you to effectively run the analysis and output effect summaries w/ CIs for any particular defined pathway (set using the predictors and mediators arguments). So you would do this separately for every pathway you're interested in.

You can test this out with the dev version if you want (devtools::install_github("murphymv/semEff@dev")), and let me know how you get on? Although note that some stuff may change prior to release of the next main version.

In future updates I might look to output the effects/CIs for all individual indirect effects in a single table or something, so that you would only ever need a single call to semEff(). But this would involve substantial changes to existing code I think, so no promises on when. Although it's been said that Coffee makes me work faster... 👀.

Cheers,
Mark

@murphymv murphymv added the enhancement New feature or request label Aug 13, 2023
@mvedrin
Copy link
Author

mvedrin commented Aug 14, 2023

Hey Mark,

Thanks! Cool, I'll see if I can figure out how to get it via the predictors/mediators argument.

And happy to support a coffee for all of the help you and this package has provided in doing my research!

Cheers,
Matt

@murphymv
Copy link
Owner

Thanks Matt, let me know how you get on with it.

Cheers,
Mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants