class: center, middle, inverse, title-slide .title[ # Analysing Your Data ] .subtitle[ ##
Gotta Get ThRu This
💪
] .author[ ### Dr Danielle Evans ] .date[ ### 9 Feb 2024 ] --- <style type="text/css"> a { color: #009af5; font-weight: bold; } a.glossary { font-weight: bold; color: #8e7df1; cursor: help; position: relative; } .remark-inline-code { font-size: var(--code-inline-font-size); color: #4266ff; padding: 2px; } strong { font-weight: bold; color: black; } .remark-slide-number { color: black; opacity: 1; font-size: 0.9rem; } .hljs-github .hljs-string, .hljs-github .hljs-doctag { color: #333; } .hljs-github .hljs-literal { color: #333; } .hiddenFrame{ height:1px; width:1px; opacity: 0; } <!-- .remark-container { --> <!-- background: #000000; --> <!-- margin: 0; --> <!-- overflow: hidden; --> <!-- } --> </style> ## Before We Begin... You have 90 seconds to tell someone around you, or write down, all the **R functions** you can remember!
−
+
01
:
30
??? This workshop aims to help you get stuck in to your analyses by serving as a reminder of the huge range of analytical skills you have developed throughout your degree, giving you a few tools of how you can put them into practice, and where you can find additional resources so a lot of you might be feeling really stuck right now, and a bit lost maybe with ur analyses and what u need to do in R, might be feeling a bit anxious as well and thats okay, but i am here to tell u that you really dont need to be, because u know what ur doing, you might just need to be reminded that you do, and need a lil refresher of all the stuff that is in ur brain, so, as a lil game to test it out, before we begin, i would like u to have a go at either wrriting down all the R functions u can remember, or telling the person next to u or in front of u --- ## Overview - **Introduction** - Posit Cloud RefreshR - Data Management - **From Analysis Plan to Analysis Pipeline:** + **E**xplore, **P**rep, **V**isualise, **A**nalyse & **P**resent - **Getting Help** - Finding ResouRces - R Help Desk -- <br> <div class="smile" style="font-size:90%"> <p><b>Keep in Mind!</b> <i>Alllll</i> of you will be at completely different stages with your data collection, prep, & analysis & that's OK - don't compare yourself to others!!</p> </div> --- ## What You Need: - Agree to the terms and conditions of the service using [this quiz](https://canvas.sussex.ac.uk/courses/27521/quizzes/39316) - [Join](https://canvas.sussex.ac.uk/courses/27521/pages/join-dissertation-posit-cloud-workspace) the dissertation workspace on Posit Cloud - Open [this project](https://posit.cloud/spaces/421021/content/lists/8800?sort=sequence_asc) - Open the **analysis_demo.qmd** if you want to follow along - Open the **analysis_pipeline.qmd** to make notes on the session today! --- ## Introduction - Conducting your analyses can often feel very overwhelming - Trying to figure out exactly where to start can make you feel like you have **no idea what you're doing** - But I'm here to tell you that **you <i>do</i> know!** - Starting on your analyses can feel scary but it's the **most exciting part**!! You can finally uncover the answers to your **research questions**! - Analysing your data allows you to **gain knowledge** about phenomena that no one else in the world knows yet - and then you get to tell everybody about it in your dissertation... <style type="text/css"> .red.remark-slide-content { background-color: #000000; font-size: 1rem; padding: 0; width: 100%; height: 100%; } .empty.remark-slide-content { font-size: 1rem; padding: 0; width: 100%; height: 100%; } .empty .remark-slide-number { color: #00000000 } </style> --- class: red <p align="center"> <iframe width="900" height="600" src="https://www.youtube.com/embed/J4CE1a1tJAI?rel=0&modestbranding=1&controls=0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> </p> --- ## Spilling The Tea - Valentine's Day is coming up 🙄... **romanticise your results** instead!! 😍 - No one else in the world knows what you've found, your dissertation is your chance to **share it** - But first before we can share our findings with the world, we need to **analyse** our data and **interpret** our results to know what we've actually found! - Whatever your findings are, they are **important** and **worth sharing...** <br><br><br><br><br><br> -- <div class="tu" style="font-size:90%"> <p><b>Top Tip!</b> Non-significant results are JUST as interesting as significant results (if not more so), don't fall into the trap of thinking non-significant == bad!</p> </div> --- ## Posit Cloud RefreshR - The school has invested in a license for **Posit Cloud**, which is an instance of RStudio that you can access via any web browser + This saves you needing to install R or RStudio on your machine, you can log into the cloud and RStudio and R will have been set up for you - Any project you create in the cloud will automatically have the packages from the `discovr` tutorials pre-installed - You should use the Posit Cloud to conduct your **dissertation analyses** - To access this resource you need to: - Agree to the terms and conditions of the service using [this quiz](https://canvas.sussex.ac.uk/courses/27521/quizzes/39316) - Follow [this link](https://canvas.sussex.ac.uk/courses/27521/pages/join-dissertation-posit-cloud-workspace) to join the Dissertation workspace - If you're returning from a placement year and wasn't taught with the Cloud, you can sign up for a free account [here](https://login.posit.cloud/register?redirect=https%3A%2F%2Fclient.login.posit.cloud%2Foauth%2Flogin%3Fshow_auth%3D0%26show_login%3D0) (we recommend you use your uni email), before doing the above steps --- ## Posit Cloud RefreshR - Once you have followed the previous link, you will see a workspace called **Dissertations 2023-24** <img src="data:image/png;base64,#img/clouddownload.png" width="90%" style="display: block; margin: auto;" /> - Any projects you create within this workspace are part of our organizational account (that is, they have unlimited resources) - This workspace will be archived on **15th September 2024** so please make sure to download a copy of your project before then if you want to keep it --- ## Using the Cloud [☁️](https://posit.cloud/spaces/421021/content/yours?sort=created_time_desc) - Before we can do anything with our data, we need to upload it to the cloud! - First we need to create a **new project** - Then **upload our data** - We then need to create a **new document** (Qmd, Rmd, R script, whatever you prefer) - & finally **read our data** into that file... -- <br><br><br><br><br> <div class="mb" style="font-size:90%"> <p><b>Woah!</b> You might have multiple datasets that you need to merge! We haven't taught you this, but you can get help from me to do it!</p> </div> --- ## Using the Cloud [☁️](https://posit.cloud/spaces/421021/content/yours?sort=created_time_desc) - Before we can do anything with our data, we need to upload it to the cloud! - First we need to create a **new project** - Then **upload our data** - We then need to create a **new document** (Qmd, Rmd, R script, whatever you prefer) - & finally **read our data** into that file... <br><br><br><br><br> <div class="pc" style="font-size:90%"> <p><b>Demo!</b> Let's go through a quick refreshR of how to set up a new project on the Cloud! (You don't need to copy, just watch!)</p> </div> ??? as a reminder, here's how we do that process demo new project on the cloud and opening new file switch to half completed version some considerations: data type, structure (wide vs long), multiple data files that need to be merged etc --- ## Data Management 👀 - You should **store** any research data collected during your project on a **secure University system**: i.e., **OneDrive** or **Box** - It is good practice to destroy participants **personal data** (e.g., consent forms, names) at the end of the project unless you have sought their explicit permission to retain their details for other purposes (such as contacting them for future research projects) - Data without personal identifying information may be stored up to 10 years after the completion of the project: this is the University default but **check with your supervisor** how long they would like you to store the research data for - When destroying research data, you'll need to **delete it from the Cloud** (all dissertation projects will additionally be archived on 15th September 2024), but you'll also need to **delete any local copies** of the data too --- ## The Analysis Pipeline - Now we've read in our data, & stored it appropriately, we can **analyse it**! 🥳 - The analytical process requires **multiple steps** - I couldn't think of a good acronym for it... 😓 so we have **EPVAP**: - **E**xplore - **P**rep - **V**isualise - **A**nalyse - **P**resent <br> <div class="mb" style="font-size:90%"> <p><b>Watch Out!</b> <i>Your</i> analysis pipeline might not follow this exact order - it might be more of a back and forth process!</p> </div> ??? we'll go through each of these analytical components and we'll have a brief refreshr on some code! --- ## For Today: - We're going to talk about the **purpose** of each step in the **analysis pipeline** - & we're going to remind ourselves what **functions** might be useful to complete each step of the **analysis pipeline** - Open [this assignment](https://posit.cloud/spaces/421021/content/lists/8800?sort=created_time_desc) on the Cloud to access the **analysis_demo.qmd** file I'm going to demo with - This Cloud project also contains an **analysis_pipeline.qmd** that I encourage you to take notes in as we go through each topic! - A Word doc version is available on [Canvas](https://canvas.sussex.ac.uk/courses/27521/pages/analysing-your-data) too if you'd prefer that - You can come back to these files later on when you do your **analysis**! - You might also find it helpful to have your **analysis plan** to refer to for today's session --- ## Explore - Once we've successfully imported our data, data exploration is the first step in data analysis! <iframe src="https://embed.polleverywhere.com/free_text_polls/4e10IYCCAkO7ifE4slWSe?controls=none&short_poll=true" width="800px" height="450px"></iframe> --- ## Explore - Why? - To gain a deeper **understanding** of the dataset - To view what **variables** exist in the data - To understand the **characteristics** of the data - To examine any **missing data** or **anomalies** - To check over the **structure** of the data to see what needs **wrangling** --- ## Explore - How? - The following functions are useful for **data exploration**: - View() & print() - names() - nrow() - ncol() - summary() - table() - str() - class() - levels() --- ## Prep - Data prep is usually the longest part in data analysis! <iframe src="https://embed.polleverywhere.com/free_text_polls/ueHdvfMmSVlGA7Ai1SJGD?controls=none&short_poll=true" width="800px" height="450px"></iframe> --- ## Prep - Why? - **Transforming** data from one form into another to make it appropriate for **further analysis** - **Organising** data to make it easy to work with - **Cleaning** data to fix any errors or issues - **Restructuring** data for a specific analysis - Dealing with **missing data** --- ## Prep - How? - There are countless functions for **data prep**: - select(), mutate(), filter() & slice() - rename() - recode() & replace() - as.numeric() & as_factor() - mean() & sum() - rowwise() & c_across() - pivot_wider() & pivot_longer() (I can help you with these!) <br> <div class="tu" style="font-size:90%"> <p><b>Top Tip!</b> Write <b>#comments</b> as you go to keep track of what you're doing at each step!</p> </div> --- ## Visualise - Data viz can take place at multiple times during data analysis! <iframe src="https://embed.polleverywhere.com/free_text_polls/B9EyBbSBZm7qtNbs3Jg9q?controls=none&short_poll=true" width="800px" height="450px"></iframe> --- ## Visualise - Why? - To look at **trends** in our data - To examine **relationships** between variables - To check **model assumptions** - To formally **present** our findings --- ## Visualise - How? - The ggplot2 package is our go to for **data viz**: - geom_boxplot() - stat_summary() - geom_violin() - geom_point() - geom_smooth() - But we can also use other functions for interactions & for data exploration/model checks: - afex_plot() - ggscatmat() - plot() - autoplot() <br> <div class="tu" style="font-size:90%"> <p><b>Top Tip!</b> Draw out your graph by hand before you attempt it in <b>R</b> - you'll have a clearer idea of what you're trying to achieve with code!</p> </div> --- ## Analyse - Data analysis is considered the main part, but there's so much more to it! <iframe src="https://embed.polleverywhere.com/free_text_polls/UOy0T3wuOi7f75l8FMu4f?controls=none&short_poll=true" width="800px" height="450px"></iframe> --- ## Analyse - Why? - To answer our **research questions** - To test our **hypotheses** - To look at **differences** between groups - To look at **relationships** between variables - To look at the **structure** of a construct --- ## Analyse - How? - SO many functions for **data analysis**: - lm(), lmRob(), glm(), model_parameters() & aov_4() - t.test(), correlation() & cor.test() - tidy(), glance() & summary() - joint_tests(), contrasts() & estimate_contrasts() - anova() & parameters() - sem(), fa.parallel(), fa(), omega() & alpha() - cohens_d(), hedges_g(), glass_delta(), omega_squared() & eta_squared() <br> <div class="mb" style="font-size:90%"> <p><b>Woah!</b> The <a href="https://de-sussex.shinyapps.io/DissRtation_HelpR/" style="color:#ff66ad;" target="_blank"><b>Model SelectR</b></a> can help you decide which analysis is appropriate if you're stuck!</p> </div> --- ## Present - Presenting data clearly is super important! <iframe src="https://embed.polleverywhere.com/free_text_polls/pLIvASkYRTLupwKZaR502?controls=none&short_poll=true" width="800px" height="450px"></iframe> --- ## Present - Why? - To formally present the **results** of our analyses - To **summarise** large chunks of information - To make it easy for our reader to **understand** our findings --- ## Present - How? - As with everything in **R**, there's lots of ways we can present data: - summarise() & group_by() - n(), sd(), mean(), min(), max() & mean_cl_normal() - rempsyc::nice_table() & apa_table() - kable(), kable_styling() & round() - write_csv() - ggsave() <br><br><br> <div class="tu" style="font-size:90%"> <p><b>Top Tip!</b> You don't have to create pretty APA style tables in <b>R</b> - you can recreate them in whatever software you're using to write your dissertation!</p> </div> --- ## Finding ResouRces & Getting Help - **Your supervisor** is the go-to person for ALL statistical, analytical, and code questions - If they are unable to help with **code specifically** you can come to the [R Help Desk](https://de-sussex.shinyapps.io/DissRtation_HelpR/)! - Don't forget you have access to all the teaching materials we've used throughout your degree [Canvas > Modules > All Modules > Past Enrolments] + The [DissRtation HelpR](https://de-sussex.shinyapps.io/DissRtation_HelpR/) & the [R-Dex](https://de-sussex.shinyapps.io/DissRtation_HelpR/) can help you navigate all those materials & where to find different topics! - You can also find help online (Google, Stack Overflow, R Cheatsheets, package help documentation etc) but **be cautious copying code you don't understand**!! <br><br> <div class="sweat" style="font-size:90%"> <p><b>Be Aware!</b> If your dissertation analysis is something we haven't taught you, your supervisor must teach it to you!</p> </div> --- class: middle center # Keep in mind... --- class: center <br><br><br><br><br><br><br> # Keep in mind... # You <i>can</i> do this!!!! <br><br><br> <p> <img src="data:image/png;base64,#img/2.png" width="20%" /> </p> ??? just getting started is the hardest part its totally normal to feel anxious and to procrastinate we all do it, but if you leave it to the last minute you will regret it allow yourself time to do it just gotta take that first step and the rest will flow so believe in yourselves like i do and take that first step! --- ## Before We Finish... You have another 90 seconds to tell someone around you, or write down, all the **R functions** you can remember now!
−
+
01
:
30
--- ## From Analysis Plan to Analysis Pipeline - For the remainder of the session, I'll hang around to answer questions and guide any of you with filling in the rest of your **analysis plan** or **analysis pipeline** - You can use these completed docs almost like a **Recipe** for when you start working in **R** - This allows you to approach your analyses in a more **systematic** way which will help with any **R confusion**! - Remember, we want to be easy on ourselves and not overcomplicate things! Some **prior planning** will help us with that <br><br><br> <div class="pc" style="font-size:90%"> <p><b>Task!</b> Try to add in what functions and teaching materials you'll use or where you can find resources to help you with each step to the pipeline doc!</p> </div> ??? Get started on filling in parts of ur analysis plan with actual code or functions required or what materials you can use or where to find resources on how to do it --- ## *That's all - happy dissertating!* <p align="center"> <iframe width="1000" height="450" src="https://www.youtube.com/embed/830KwNb3Fbs?rel=0&modestbranding=1&controls=0" title="The statistical analysis" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> </p> .center[ [Give session feedback here!](https://forms.gle/ZyXAB7kZzUUyct9n6) ] --- class: empty <div class="padlet-embed" style="border:1px solid rgba(0,0,0,0.1);border-radius:2px;box-sizing:border-box;overflow:hidden;position:relative;width:100%;background:#F4F4F4"><p style="padding:0;margin:0"><iframe src="https://uofsussex.padlet.org/embed/sogo6j73nygyw6th" frameborder="0" allow="camera;microphone;geolocation" style="width:100%;height:650px;display:block;padding:0;margin:0"></iframe></p><div style="display:flex;align-items:center;justify-content:end;margin:0;height:28px"><a href="https://padlet.com?ref=embed" style="display:block;flex-grow:0;margin:0;border:none;padding:0;text-decoration:none" target="_blank"><div style="display:flex;align-items:center;"><img src="https://padlet.net/embeds/made_with_padlet_2022.png" width="114" height="28" style="padding:0;margin:0;background:0 0;border:none;box-shadow:none" alt="Made with Padlet"></div></a></div></div>