Alesha
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    > []# PSYC3361: Presentation Transcript *(Alesha)* **Intro** Hi guys, let’s get into the presentation! Firstly, we want to discuss the article background with you! **Slide 1** It is known that emotional wellbeing improves across the age lifespan, yet it is unclear how this brings age-related advantages in humans. To answer this question, the experimenters examined age groups and their emotional experience with the COVID-19 pandemic to determine — would emotional gains persist in older individuals when exposed to prolonged and inescapable stress compared to younger individuals? So, the study preregistered a sample of 970 Americans between 18-76 years, with a final sample of 945. The participants self-reported a range of measures, as you can see here. The study results extend on previous research, demonstrating that older adults have greater emotional wellbeing and resilience persisting in the face of prolonged and inescapable stress by prioritising on positive, meaningful life events. Moving on to our reproducibility goals **Slide 2** We set out to reproduce their demographic and descriptive stats for the reported variables. Our demographics reproduced, but sadly none of our descriptive stats reproduced but these differences were insignificant with decimals being off. There were also some descriptive stats missing such as some individual items and personality traits. We then reproduced Table 1 which consisted of 29 emotions with their corresponding means, standard deviations, and 95% confidence intervals which all seemed to reproduce nicely. Lastly, we set out to reproduce Figure 1 which consisted of four scatterplots examining positive and negative emotions against frequency and intensity of emotional experience. It seemed that these plots reproduced, however, we cannot confirm this, as correlation coefficients were not given. Yet, we see a general trend of older participants having lower frequency and intensities for negative emotions and higher for positive emotions. And now ill pass onto Daniel to talk about our challenges! *(Daniel)* **Slide 3** So our first challenge was simply getting the rename function to work for most of us. Yeah, basic, but it WAS a problem! We looked at using quotation marks, different commas, colons but those did nothing. We even shared the code that worked on ONE computer but it still did not rename the variables for the rest of us. Then, Google came in handy. By copying and pasting the exact error message we wound up on discussion boards where other people experienced the same problem. Here we found that inserting ‘dplyr::’ before the rename() function, would tell R that we want to use the rename() within the dplyr package. And it finally worked! Interestingly, this seemed to be a Mac, rather than windows problem... shows that different technologies may require different solutions! And it showed us how to SEARCH on Google a bit better for troubleshoots. **Slide 4:** A later challenge was creating the means and SD table efficiently… We figured that we could code each mean and SD by itself, rounded to three decimal places as shown here, then plop it into a table. This is not wrong, but we had 29 emotions to code. A little bit tedious I’d say. OVERCOMING IT: We first thought that this would be the only way to do it, which was not inherently wrong again; but Kritika found a more efficient way by creating a new dataset and then applied code that was able to produce means and sd to the whole dataframe! So much more efficient, just needed a fresh eye… BUT that leads us to our other challenge - figuring out how to produce the CIs in the table. For about 2 weeks, it seemed like nothing worked.So, back to doing everything MANUALLY? 29 times? Thankfully, no, because again we needed a fresh eye and a little push from Yuki to find a more efficient way by creating a new data frame and use the mutate function to apply the CI formula across all 29 emotions. And that’s why coding like caterpillars is the way. *(Kritika)* **Slide 5:** So what were our triumphs? Producing figure 1 was probably the biggest one we had! We had to create a 4 plot figure from scratch using only our coding skills and the data we were given. For me (and I think my group can agree), it seemed like an incredible feat. So if we look at the figure, you can see we had to reproduce 4 different scatter plots and each had different features to it. For example, the top right one had no ticks, labels or information, just a title. And this can be contrasted with the bottom left one. What this means is that each scatterplot required different coding so it was not an easy copy and paste job. I started with the ‘Positive Emotions’ because as a novice it seemed the most easiest to reproduce, and enabled me to create a base code for the other plots. And the code for this plot is on the right! [show code]. Once we had the four individual scatter plots when then had to merge them together so it would become one figure, which required even more code. ``` scatterplot2 <- ggplot(data = csv_data) + geom_point(alpha = 0.05, size = 2.5, mapping = aes( x = age, y = positive_frequency)) + geom_smooth( mapping = aes( x = age, y = positive_frequency ), method = lm, lwd = 1.5, colour = "black", fill = "darkgray", se=TRUE) + ylim(0, 2.5) + theme_minimal() + theme_apa() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), axis.text.x = element_blank(), axis.ticks.x = element_blank(), axis.text.y = element_blank(), axis.ticks.y = element_blank()) + theme(plot.margin = margin(0.1, 0.9, 0.1, 0.3, "cm")) + ggtitle(label = "Positive Emotions") + theme(plot.title = element_text(vjust = 0.5)) + theme(plot.title = element_text(face = "plain")) + theme(plot.title = element_text(hjust = 0.5)) ``` **Slide 6:** So another one of our triumphs would be to do with reproducing Table One. While figuring out the code for the confidence intervals in and of itself was a massive triumph, figuring out how to format the table, so that when we knitted it into a PDF, it would be in APA formatting was quite challenging. But thanks to Alesha we were able to figure it out! As per APA we need to have the lower and upper CI within the one cell and then separated by a comma and encased within square brackets. This required us to have concatenated data - which means to have a sequence of data within the one cell. So, here we had to paste the lower and upper CI’s and then insert a comma and space between them. The first code was used for this: [show code]. ```{r} positive_frequency_concatenated_ci <- data.frame( paste(positive_frequency_total_ci$positive_frequency_lci, positive_frequency_total_ci$positive_frequency_uci, sep = ", ")) %>% dplyr::rename("95% CI" = paste.positive_frequency_total_ci.positive_frequency_lci..positive_frequency_total_ci.positive_frequency_uci..) ``` Then we needed to add the square brackets using the second lot of code: [show code] ```{r} # add square brackets around CI positive_frequency_concatenated_ci$"95% CI" <- with(positive_frequency_concatenated_ci, paste0("[", positive_frequency_concatenated_ci$"95% CI", "]")) ``` So here we are telling R to paste a square bracket before and after the confidence intervals. The above code produce the following output and we applied it to the whole dataframe to produce table 1. --- (Charlie) Slide 7: Across our varied experiences in the term in experimenting with novel code, our group learnt the following key points about learning R. Firstly, openness to mistakes. Learning R requires an acceptance of the process of trial-and-error. As a team, we became used to consistent error messages, and learnt to embrace our mistakes as stepping stones rather than barriers. This was most applicable to us when refining the data set in preparation for Figure 1. You can see here (point) that I made the basic mistake of encoding my renamed variables within a name that was the same as the original dataset. This created issues with reproducing the scatterplots required for Figure 1. This brings us to the second point, the importance of asking questions and seeking diverse sources. As previously discussed by Daniel and Kritika, many of our group members experienced diverse initial issues with the renaming function. Although we discussed this as a group, we quickly realized that we had to seek external sources, and decided to seek Yuki in our Week 5 Lab. Her solution is shown here (point) - she explained that we had to rename the piped dataset differently to the original to ensure that the integrity of the original data. This reinforced the importance of seeking a diverse range of support when faced with roadblocks, including Google search. --- Slide 8: And finally, we learnt that learning R requires flexible solutions. Although we may want to have the cleanest and most refined code, learning R requires us to stop being such perfectionists sometimes! This is best highlighted by some of our creative and laughably simple solutions. For example, when we first develop Table 1, we did not indent the emotions under their ‘Positive’ and ‘Negative’ subheadings. Initially, we found that we could just insert 2 spaces before each variable, however later Alesha found indent functions within the gt package, after first exploring the Flextable and kableExtra packages, that provided a more sophisticated and formal solution. Regardless, openness and appreciation of the flexibility of R is key to learning – sometimes, the ‘clean code’ can also be the most complicated to find. --- (Angie) Slide 9: So, what did we learn about computational reproducibility? Through our coding experience, we learn that… • Reproducibility is difficult even with open data. Even if the data was open, it does not mean it is easily reproducible. However, in our paper, the data was not completely open either. The individual items of subjective health were missing, and data from excluded participants were also missing. This meant that we could not reproduce exactly to what was in the article. Further we learnt that... It takes a lot of time and effort to reproduce code. Our study contained 107 variables which was A LOT! So, this meant there would be a lot of coding for the separate variables. However, we always attempted to find easier solutions and we attempted to continually simplify the formatting for figures and scatterplots. Slide 10: So, what about working in a team? As advised by Kate, we decided to not do the approach of divide and conquer and instead allowed everyone to try out the coding for themselves. We wanted to do this so everyone could have a taste of coding and because it allows us to bounce ideas off each other while working on it. This wouldn’t have occurred if each person was allocated to do one part. This allows for diversity as everyone has different strengths and team members were able to do tasks at their own pace and at their own ability. This meant that… Communication is essential, delivered through weekly meetings. Sharing our code on a shared Hackmd allowed us to communicate our progress and allows us to work cohesively together where we would troubleshoot whenever someone came across an issue. With our approach, it also meant that sometimes we get different ways of reproducing the same figures and tables and sometimes our methods overlapped, therefore, we had to communicate and choose which method would be best and most efficient to use or mesh the ideas together. ---

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully