You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Dustin. First thank you for the wonderful packages, they've been really helpful.
I noted whist using the sterr option on flexplot that the errorbars were inconsistent with ones I produced manually when plotting in ggplot. Looking through the flexplot helper functions (where sterr is calculated) you have:
else if (spread=="sterr"){
summary1 = "stat_summary(fun.y='mean', geom='point', size=3, position=position_dodge(width=.5), color = '#bf0303')"
summary2 = "stat_summary(geom='errorbar', fun.ymin = function(z){mean(z)-1.96*(sd(z)/sqrt(length(z)-1))}, fun.ymax = function(z){mean(z)+1.96*(sd(z)/sqrt(length(z)-1))}, width=.2, linewidth = 1.25, position=position_dodge(width=.2), color = '#bf0303')"
Is this the correct calculation for SEM? Should it not be SEM=SD/sqrt(n)? You have a 1.96 multiplier which I think is for 95% CI's and you also have an n-1 term which is for sample SD calc. Any clarification would be greatly appreciated.
Thanks
Aman
The text was updated successfully, but these errors were encountered:
Hello Dustin. First thank you for the wonderful packages, they've been really helpful.
I noted whist using the
sterr
option on flexplot that the errorbars were inconsistent with ones I produced manually when plotting in ggplot. Looking through the flexplot helper functions (where sterr is calculated) you have:else if (spread=="sterr"){
summary1 = "stat_summary(fun.y='mean', geom='point', size=3, position=position_dodge(width=.5), color = '#bf0303')"
summary2 = "stat_summary(geom='errorbar', fun.ymin = function(z){mean(z)-1.96*(sd(z)/sqrt(length(z)-1))}, fun.ymax = function(z){mean(z)+1.96*(sd(z)/sqrt(length(z)-1))}, width=.2, linewidth = 1.25, position=position_dodge(width=.2), color = '#bf0303')"
Is this the correct calculation for SEM? Should it not be SEM=SD/sqrt(n)? You have a
1.96
multiplier which I think is for 95% CI's and you also have ann-1
term which is for sample SD calc. Any clarification would be greatly appreciated.Thanks
Aman
The text was updated successfully, but these errors were encountered: