-
Notifications
You must be signed in to change notification settings - Fork 73
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
Code for plotting continuous effect #198
Comments
Hmm, that shouldn't be happening! Sorry, not sure. Have you convinced yourself it's the calculated values themselves and not a plotting issue with Unrelated: are you sure you're plotting 95% CI? The script you linked to does 90% CI by default unless you've changed it on lines 84-89. |
I believe it is plotting the df correctly. Looking at the df for the first time interval in May, the median is 0.11, the 'low' value 0.04 and 'high' .05. For August it's: median 0.54, low 0.36, and high 0.52. And yes, I did change it to 95% CI by just moving the #'s from the default. Thanks. |
Shoot. Has anyone else seen this before? @AndrewLJackson @andrewcparnell @ericward-noaa |
Haven't seen this before I'm afraid - though a possible thought is that's something to do with transformations from e.g. clr/ilr space to proportions. Sometimes errors bars can get out of order. Any chance of an MRE? |
Something else I noticed in the df is that for some of my sources the values in the 'high' and 'low' columns are reversed. As in the value in the 'high' column is lower than the 'low'. But in most cases still around the median. |
Interesting. If you can post/send a MRE like Andrew suggests, I can take a look since it seems like a problem with the transformation code. |
I think there's a couple potential issues. First -- @SejerMeyhoff , I assume you have checked the way you're putting the dataframe together? If that's not the case, looking at the plotting script for the alligator example, I think there's potentially a problem in the order of operations. The way it's set up now is that (1) the quantiles on the proportions are taken in ILR space, and then (2) transformed from ILR to normal space. I think these should be switched. It's computationally a lot more to back transform all the proportions, but then generating the quantiles wouldn't lead to wonky behavior. |
Thank you for the comments everyone. @ericward-noaa I must admit I am not that R savvy. I have a basic understanding of how the script works, but I hadn't thought of that. I will give it a shot, thanks. |
@brianstock gladly, could you provide some guidance on how to do that? e: sent you an email |
Sorry for taking so long to get to this. These bugs should be taken care of now. I tested the fix using your grouse data, so you should be all set. I also added new options for these plots:
|
Thank you Brian!
Sejer
…On Thu, 15 Oct 2020 at 11:49, Brian Stock ***@***.***> wrote:
Sorry for taking so long to get to this. These bugs should be taken care
of now.
I also added new options for these plots:
- alphaCI lets you set the credible interval width (default = 0.05,
gives 95% CI)
- exclude_sources_below will not plot sources with median proportion
below this level for the entire range of continuous variable (default =
0.10)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#198 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANRVVFUQYEGDFZMUYL2TV53SK4YZTANCNFSM4KG2SRCA>
.
|
@SejerMeyhoff @brianstock I'm having a difficult time figuring out how to produce figure 5 from that report by modifying Brians script for figure 6. Would you perhaps give me a pointer (or several) or share your script with me so that I can produce a ribbon plot similar to yours? I'm trying to portray diets with 4 sources over a gradient of glacial coverage (continuous). My script can be provided. Arggh |
I'll add that plot_continuous_var isn't working for me, although that could be user error? |
Do you have v3.1.12 installed? |
Yes that is the version I am working with. An warning message is displayed: Warning message: Furthermore, the output of plot_continuous_var() comes out NULL. Is there a degree of continuity required for the function to work? In my mix I am using dummy variables 1-5 to represent a continuous gradient that my sites were chosen by and there are two factors (one fixed, one random, neither nested). Sources are means with no factors. If I run the model with only one fixed factor it seems to work. Thoughts? |
Sorry, it's hard for me to diagnose the problem without seeing your data and model output. If you send me an email I can try to troubleshoot: bstock09@gmail.com. |
Hi Brian,
I have a quick question about the code you put together for plotting continuous effects in the alligator example (#180). I've been able to use your code for plotting diet proportion against time with my models, and it works great most of the time. However, once in a while I get a plot where the median line is outside of the upper and lower bound of the ribbon (95% CI), like in the plot I have attached.
I didn't really change anything in your script aside from the number of lines and ribbons in the plot. Is there an obvious reason for this that I am missing?
The text was updated successfully, but these errors were encountered: