![Lacey Maths & Stats Consultancy](/img/default-banner.jpg)
- Видео 42
- Просмотров 62 483
Lacey Maths & Stats Consultancy
Ирландия
Добавлен 3 июл 2020
Welcome to Lacey Maths & Stats Consultancy's RUclips channel. Through various learning resources, this channel will be about promoting good practice in mathematical and statistical analysis for all levels.
Make sure to click the SUBSCRIBE button and we will see your comments and you'll have access to numerous resources that will support you in your journey with Maths & Stats!
- ABOUT -
Lacey Maths & Stats Consultancy Co. Ltd was founded in 2011. The company’s main body of work is two-fold:
1. Consultancy
Lead statistician on clinical trial/non-intervention studies.
2. Statistical Training Courses
Provide statistical training tailored to client needs with a strong emphasis on good practice in statistical analysis. The training courses are predominantly computer based using software packages such as Minitab, MS Excel, NVivo, RStudio and SPSS.
Make sure to click the SUBSCRIBE button and we will see your comments and you'll have access to numerous resources that will support you in your journey with Maths & Stats!
- ABOUT -
Lacey Maths & Stats Consultancy Co. Ltd was founded in 2011. The company’s main body of work is two-fold:
1. Consultancy
Lead statistician on clinical trial/non-intervention studies.
2. Statistical Training Courses
Provide statistical training tailored to client needs with a strong emphasis on good practice in statistical analysis. The training courses are predominantly computer based using software packages such as Minitab, MS Excel, NVivo, RStudio and SPSS.
Plot of Effect Sizes from Pairwise Comparisons
Short video demonstration on plotting effect size statistics to complement pairwise comparison results from emmeans() in RStudio.
Script used in the video can be downloaded from: github.com/seanwithafada/Plot-of-Effect-Sizes-from-Pairwise-Comparisons.
Script used in the video can be downloaded from: github.com/seanwithafada/Plot-of-Effect-Sizes-from-Pairwise-Comparisons.
Просмотров: 466
Видео
Effect size of Pairwise Comparisons using emmeans
Просмотров 2,6 тыс.2 года назад
A short video on generating effect size statistics to complement pairwise comparisons results from emmeans() in RStudio. Script used in the video can be downloaded from: github.com/seanwithafada/Effect-size-of-Pairwise-Comparisons-using-emmeans.
Generating a Randomisation Schedule
Просмотров 2702 года назад
Short video on generating a randomisation schedule in RStudio. Script used in the video can be downloaded from: github.com/seanwithafada/Generating-a-Randomisation-Schedule.
Interaction plots in ggplot2
Просмотров 1,4 тыс.2 года назад
A short video demonstrating how to produce interaction plots in RStudio using the ggplot2 package, for a continuous measurement in terms of 2 factors, 3 factors and 4 factors. Script used in the video can be copied from the following: github.com/seanwithafada/Interaction-plots-in-ggplot2.
Estimated Marginal Means in ggplot2
Просмотров 3,5 тыс.2 года назад
Calculation and plotting of estimated marginal means from a linear mixed model and ANOVA with two factors. Script used in the video can be downloaded from: github.com/seanwithafada/Estimated-Marginal-Means-in-ggplot2.
Spaghetti plots in ggplot2
Просмотров 1,9 тыс.2 года назад
Short video on various tweaks to RStudio script to generate spaghetti plots in ggplot2. Script used in the video can be downloaded from: github.com/seanwithafada/Spaghetti-plots-in-ggplot2.
Highlighting boxplots in ggplot2
Просмотров 4282 года назад
A short video demonstrating script that could be used to highlight a boxplot in a sequence of boxplots for one and two factors using the mutate and ggplot functions in RStudio. Script used in the video can be downloaded from: github.com/seanwithafada/Highlighting-boxplots-in-ggplot2. Also, here are the links to other videos on: - Editing boxplots - ruclips.net/video/xo_EBOiYiEA/видео.html; - La...
Labelling outliers in ggplot2
Просмотров 2,8 тыс.2 года назад
A short video demonstrating script to label outliers in boxplots using ggplot. Script used in the video can be downloaded from: github.com/seanwithafada/Labelling-outliers-in-ggplot2. Here is the link to another video on editing boxplots using ggplot2: ruclips.net/video/xo_EBOiYiEA/видео.html.
Boxplots in ggplot2
Просмотров 3,8 тыс.2 года назад
Demonstration of sample RStudio script on formatting boxplots using ggplot2: - Including Whiskers; - Labelling and Scaling Axes; - Changing Colours; - Including Mean Point; - Dot plot v. Jitter plot; - Annotating Participant ID; - Labelling Outliers. Script used in the video can be downloaded from: github.com/seanwithafada/Boxplots-in-ggplot2.
Histograms in ggplot2
Просмотров 4503 года назад
Demonstration of sample RStudio script on formatting histograms using ggplot2: - Setting Intervals/Bins; - Labeling and Scaling Axes; - Annotating Bars with Frequencies; - Including/Excluding Cut-points; - Probability Density Function Curve; - Split by Factor(s); - Colours of Bars. Script used in the video can be downloaded from: github.com/seanwithafada/Histograms-in-ggplot2.
Incremental Area Under the Curve
Просмотров 1,2 тыс.3 года назад
Demonstrates incremental Area Under the Curve (iAUC) Cut and Min methods using RStudio. Script used in the video can be downloaded from: github.com/seanwithafada/Incremental-Area-Under-the-Curve. Follows from a previous video (ruclips.net/video/28WKEPtaIkQ/видео.html) outlining the steps involved in determining the total Area Under the Curve using Trapezoidal's rule, along with Positive Increme...
Repeated Measures ANOVA & Linear Mixed Models in RStudio
Просмотров 6 тыс.3 года назад
A short video demonstrating script for Repeated Measures ANOVA & Linear Mixed Models in RStudio. Functions used are ezANOVA(), aov_car(), lme() and lmer(). Script used in the video can be downloaded from: github.com/seanwithafada/Repeated-Measures-ANOVA-Linear-Mixed-Models-in-RStudio.
Hypotheses, Level of Significance and p-values
Просмотров 4633 года назад
A brief overview to some statistical terminology to complement statistical testing - null and alternative hypotheses, types of error, level of significance, p-values and effect sizes.
Summarising a Linear Model Selection Process in RStudio
Просмотров 1653 года назад
This video demonstrates an approach to summarising a linear model selection process in RStudio, followed by writing the results to Excel. Script used in the video can be downloaded from: github.com/seanwithafada/Presenting-Linear-Regression-Analysis-Results.
Presenting Multiple Linear Regression Analysis Results in RStudio
Просмотров 2 тыс.3 года назад
This video demonstrates a sample presentation style to multiple linear regression analysis results using RStudio, followed by writing the results to Excel. Script used in the video can be downloaded from: github.com/seanwithafada/Presenting-Linear-Regression-Analysis-Results.
Presenting Simple Linear Regression Analysis Results in RStudio
Просмотров 6423 года назад
Presenting Simple Linear Regression Analysis Results in RStudio
F-ratio calculation in Excel (Randomised Block Design)
Просмотров 1073 года назад
F-ratio calculation in Excel (Randomised Block Design)
F-ratio calculation in Excel (Two-Way ANOVA)
Просмотров 2853 года назад
F-ratio calculation in Excel (Two-Way ANOVA)
F-ratio calculation in Excel (One-Way ANOVA)
Просмотров 1,2 тыс.3 года назад
F-ratio calculation in Excel (One-Way ANOVA)
Power Analysis in G*Power & RStudio (RM ANOVA)
Просмотров 1,1 тыс.3 года назад
Power Analysis in G*Power & RStudio (RM ANOVA)
Power Analysis in G*Power & RStudio (t-test)
Просмотров 9013 года назад
Power Analysis in G*Power & RStudio (t-test)
Incremental Area Under the Curve (iAUC)
Просмотров 6 тыс.4 года назад
Incremental Area Under the Curve (iAUC)
Summarising paired samples t-test and Wilcoxon test results in RStudio
Просмотров 2124 года назад
Summarising paired samples t-test and Wilcoxon test results in RStudio
Summarising independent samples t-test and Mann-Whitney U-test results in RStudio
Просмотров 2054 года назад
Summarising independent samples t-test and Mann-Whitney U-test results in RStudio
Summarising one-sample t-test and Wilcoxon test results in RStudio
Просмотров 2504 года назад
Summarising one-sample t-test and Wilcoxon test results in RStudio
Checking homogeneity of variances, sphericity and writing RStudio results to Excel
Просмотров 9894 года назад
Checking homogeneity of variances, sphericity and writing RStudio results to Excel
Checking normality of measurements in RStudio
Просмотров 2054 года назад
Checking normality of measurements in RStudio
SPSS Syntax to format dataset and reorder negatively worded questions before a Factor Analysis
Просмотров 1164 года назад
SPSS Syntax to format dataset and reorder negatively worded questions before a Factor Analysis
Hello - first, thank you for posting this very helpful video. Regarding this line of code: res2$n/4+2, which you used to justify the final total sample size (sample size/numbers of levels -1 + 2). I recently purchased the textbook "Practical Statistical Power Analysis" by the developers of Web Power and it seems (at least according to my reading) that the sample size calculated by the wp.rmanova function is the total sample size. More specifically, I couldn't find any justification in the authors' examples for the line of code that you added afterwards. At the same time, I suspect that it is correct given alignment with G*Power. Can you help me understand how you decided to use that line of code when the developers of Web Power themselves have not (seemingly) addressed this issue?
Hi. Thank you for the feedback. The additional line is mainly down to determining the size per group, The first part of the additional line of n/(df of # measurements/timepoints) is clear cut, but then when I tried to align with G*Power, I found that I was regularly 2 off, i.e., # groups, for the data used. The adjustment was purely to align with G*Power. I'd imagine this adjustment is due to rounding in the sample size calculations as there is a lot happening behind the scenes. You could argue that the "+ # groups" is not needed, but then there will be a minor difference between R and G*Power in output. I just found the adjustment a minor "trick" that appeared to align both packages. Hope this helps.
Hi, I'm wondering what would be the method to find partial eta squared for the repeated measures ANOVA using lme function?
A few options out there, but I generally use the eta_sq() function in the sjstats package.
Great. Thanks for sharing knowledge.
Question: If the estimated marginal means is not your main analysis but simply used to visually present differences between groups from an earlier regression (mediation analysis), is it possible to present the visualization without the numerical analysis? Random question without much context, but just wondering if you've come across an article that does that.
I'd probably just plot the 95% CI of the means, as opposed the estimated marginal means, if all you're interested in is a visual. A video on interaction plots that I have may help here ... ruclips.net/video/IFrL4f86nIM/видео.html.
The tutor was good, but the language n the way you descibing is not atacive.
Why do the emmeans standard error values look the same from the emmeans output but they arent similar when looking at the effect size?
The output that complements the effect size are the 95% CI limits, which are different to the standard error values. The CI is the mean +- margin of error. When the margin of error is the standard error divided by sqrt(n).
If I have more than 100 samples, Should I calculate mean for each time point Or togetherly I will take all samples for Positive Incremental AUC Analysis?
I would generally work out the AUC for each individual sample.
@@LaceyMathsStatsConsultancy so If we will do for each single sample then by using all values we will perform statistical test then?
@user-pm8gz3jr1w Yes ... you set up a for loop to calculate each AUC for each sample, then create a dataframe mapping each sample to corresponding AUC.
@@LaceyMathsStatsConsultancy thank you sir for your assistance
Sir how I will create a Loop for this analysis can You please tell me. Like I will fix something in Loop take one by one sample sets for calculations of AUC?
Excellent presentation! Thanks a lot!
Thank you soooooo much for sharing this.
Thanks for the clear video! I was wondering if the presented models account for autocorrelation (and whether they even should or not)?
Not really. This is for the user to ensure that if there are multiple explanatory continuous variables in the model, that these variables are not autocorrelated, e.g., using variance inflation factor. Also, it's important that if the purpose is model fitting, that the model residuals are checked for normality and randomness.
@@LaceyMathsStatsConsultancy Thanks! Sorry I actually meant temporal autocorrelation. I find it difficult to get my head around that concept or how to properly implement it in repeated measures models!
@@designedfore I'd imagine in this case, it would be a matter of checking the autocorrelation of the residuals from the model. So if the model residuals are not approximately normally distributed and random, then there is a potential issue with the model. I can look to do a video on this, if you feel it may be of help?
@@designedfore - some interesting info on temporal autocorrelation on www.flutterbys.com.au/stats/tut/tut8.3a.html
This is such a great walkthrough of estimated marginal means and how to plot them. Thank you!!
This was fantastic, and an excellent extension to cover the gaps not clearly explained or spelled out in the emmeans vignettes. Thank you for putting this together!
sorry stupid question but how at 5 minutes in, did you bring up that extra tab which was the G power one? Thanks :)
Hi Jess, That's a package separate to RStudio which can be downloaded from: www.psychologie.hhu.de/arbeitsgruppen/allgemeine-psychologie-und-arbeitspsychologie/gpower.
Hey thank you very much for the video. Really useful! Can you please break down a little bit line 77. I couldn't find any clear explanation in the documentation. In my case I have 1 group and 4 repeated measures. So i did: (res<-ezANOVA(data = df, dv = value, wid=horse_id, within = treatment, return_aov = T)) (effect<-anova_stats(res$aov)) (eff<-effect$cohens.f[2]) (power <- wp.rmanova(n = NULL, ng = 1, nm = 4, f = eff, nscor = 1, alpha = 0.05, power = 0.8, type = 1)) (power$n) (ceiling(power$n/3+1)) # is that correct?? I am not quite sure how to interpret this in term of number of animals required for the experiment.
Yes, you are correct. It is the sample size outputted from the power calculation divided by the number of levels to the within subjects factor less one + number of levels to the between subjects factor. So, if using the notation from the script: It's the ceiling to [n/(nm - 1) + ng]. Is that ok?
@@LaceyMathsStatsConsultancy Awesome! thank you very very much!!
Awesome 👌, right at the outline and I can sense it is the best and the most informative tutorial in boxplot by all standards 👏
Thank you!
Would you go over why why 'eta' or the 'partial eta' is the aproppriate effect size estimate here? Which estimate is eff_size actually calculating for the pairwise comparisons?
eff_size outputs partial eta-squared. There are some nice points, with references to support, on eta-squared and partial eta-squared, and when to use on: stats.stackexchange.com/questions/15958/how-to-interpret-and-report-eta-squared-partial-eta-squared-in-statistically.
@@LaceyMathsStatsConsultancy thanks! great post, indeed! I've just opened a post on CV asking about that. My case is very similar to yours (youtube won't let me paste my CV link here). I have a mod1 <- lmer(Y ~ GROUP * YEAR + (1|PARTICIPANTS) and then I'm doing: emm1 <- emmeans(mod1,~YEAR|GROUP) and emmeans(mod1,~GROUP * YEAR) . Each group has 2 levels (Group 1 and Group 2) and Year has 2 levels (year 1 and year 2) too. Then I'm calculating as you've said in the video: eff_size(emm1, sigma = sigma(mod1), edf = df.residual(mod1))
so are the partial n² suitable in this case?
@Larissa Cury Partial eta-squared is what I'd use in the scenario you've outlined, clearly outlining it's classification in the Methods section of a report.
@@LaceyMathsStatsConsultancy thank you! what do you mean by cleary outlining its classification?
Thanks, do you have any tips on how to report these results?
The last few lines of script give an example of how to report the effect size statistics with corresponding p-values, em means and CIs. All that would be left is to write the results to Excel and then you are good to go.
Thank you! What about the warning about the interaction? What can (or should) we do about it?
That warning is just informing the user that there are interaction effects. Typically, the interaction effects are your primary outcome, with the main effects being your secondary outcome. The warning is not an error but just a form of signposting in case the user is not aware of interaction effect(s) being present. The effect sizes from the main effect are still accurate.
@@LaceyMathsStatsConsultancy so when I'm performing emmeans(model,~ B|C) %>% pairs(adjust="Tukey"), am I accouting for that? I don't get the warning (being the model: Y ~ B * C + (1|ID))
@@LaceyMathsStatsConsultancy thank you!
Great! Exactly what i was looking for! Thank you very much!
It is possible to compute IAUC using excel?
Very helpful. Thanks
How is it possible to generate outliers uniformly in the p-parallelotope defined by the coordinate-wise maxima and minima of the ‘regular’ observations in R?
Great! Thank you:)
It took us a while to find a video series covering syntax (including string to numeric) from start to finish. This is great. Thank you
That's great to read. Thanks for the feedback!
@@LaceyMathsStatsConsultancy You are every welcome
Amazing. Thank you
Thank you very much
Are the codes to the videos on a git repo?thanks!
No problem ... a link to the script is included in the description ⬆.
Great presentation, much appreciated.
great video, thanks a lot! I have a question: When changing the width of the errorbar, the whole whisker changes in position. Does anyone know how to fix that?
Thanks for the feedback. Within the argument to stat_boxplot, you can include width=0.25, but this upsets the position of the whiskers, however, including position_dodge(width=0.75) will fix the alignment, e.g., stat_boxplot(geom = "errorbar",width=0.25, position = position_dodge(width = 0.75)) Hope this helps.
Thanks Lacey !
Thank you for the video and scripts!!!
Thank you for your videos. Very helpful and easy to follow and understand.
I mean, some of the syntaxes and descriptions are hidden on the right side of the Rstudio
Hope the script from the following link is a help: drive.google.com/drive/folders/1qxJh5U5hzqznJG-vXlW7XvZ4uDk-S0g5?usp=sharing
Thank you for demonstrating this piece of work on mixed models, but, would have been easier if you can also deliver the syntaxes used (downloadable) for people like me.
Hi thanks for this - is there a shareable r script with the code for the incremental and net area under the curve that you show in the video?
No problem. Script can be copied from the following link: drive.google.com/drive/folders/1wvHXV-_ZPFTjTCy5FP2SgGGLBni1i_mD?usp=sharing
How do we get G*Power?
www.psychologie.hhu.de/arbeitsgruppen/allgemeine-psychologie-und-arbeitspsychologie/gpower
It is really helpful video and covers so many easy steps to make cool boxplots. Thank you so much for sharing!
Thank you for the feedback. Delighted you found the video helpful.
Thank you sir. it is useful tutorial
Thank you so much for this video! This was exactly what I was looking for. :) For upcoming videos, it will be extra helpful if you can briefly discuss how we interpret the results as well as how people typically report the results in academic papers (e.g., F(2, 87) = 1.52, p = 0.22)
It was a very good video for me, please do the next video...
Thank you...a follow-up video is on the to-do list.
The design of this thumbnail is all down to the great work of my son, Ciarán.
Hi Dear professor Lacey! I'm moving to Cork in 2022 and I'll apply to Data science course(Higher Diploma) in CIT. Will you be teaching in that course next year? Hugs from Brasil! Hope to meet you soon.
very interesting, share me the syntax
All credit for this colourful thumbnail is to my super creative daughter, Aoibhe.
A massive shout out and thank you to my niece, Saoirse, for designing the super creative thumbnail for this video.
Syntax for fix code in fix variable
Thank you for this good illustration.
No problem ... thanks for the feedback!
thank you. Very helpful
Great...thank you for the feedback!
@@LaceyMathsStatsConsultancy with 400 plus variables how do i recode all missing values to 999 for every variable at once
@@nyashapatiencemandeya1128 This syntax should do the trick: RECODE ALL (SYSMIS=999). EXECUTE.
thank you