rickdkk
    • 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
    # Collaborative Document. Day 1, Sept 26th 2022-09-26 R for Social Scientists Welcome to The Workshop Collaborative Document This Document is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents. All content is publicly available under the Creative Commons Attribution License https://creativecommons.org/licenses/by/4.0/ ---------------------------------------------------------------------------- This is the Document for today: [link](https://hackmd.io/@o3DWHyfCQNqBUaAA1JO-_A/HJkxiTA-o) ## 👮Code of Conduct * Participants are expected to follow those guidelines: * Use welcoming and inclusive language * Be respectful of different viewpoints and experiences * Gracefully accept constructive criticism * Focus on what is best for the community * Show courtesy and respect towards other community members ## ⚖️ License All content is publicly available under the Creative Commons Attribution License: https://creativecommons.org/licenses/by/4.0/ ## 🙋Getting help to ask a question, type in the chat window to get help, type in the chat window you can ask questions in the document or chat window and helpers will try to help you ## 🖥 Workshop website [link](https://steltenpower.github.io/2022-09-26-dc-socsci-R-nlesc-dccpo-online/) ### 🛠 Setup [link](https://datacarpentry.org/socialsci-workshop/setup-r-workshop.html) #### For today: - Excel of LibreOffice - OpenRefine (http://openrefine.org/download.html) - You need to download some files to follow this lesson: Download the following three files: [SAFI_clean.csv](https://ndownloader.figshare.com/files/11492171) [SAFI_messy.xlsx](https://ndownloader.figshare.com/files/11502824) [SAFI_dates.xlsx](https://ndownloader.figshare.com/files/11502827) - Place these 3 files in a folder you can easily find and access on your computer (for instance in a datacarpentry-spreadsheets folder on your Desktop or within your Home folder). ## About the data For more information about the dataset and to download it from [Figshare](http://www.datacarpentry.org/socialsci-workshop/data), check out the Social Sciences workshop data page. ## 👩‍🏫👩‍💻🎓 Instructors Ruud Steltenpool, Rick de Klerk ## 🧑‍🙋 Helpers Rins Rutgers, Margriet Miedema ## Check in ## Introduction ### Exercise **How many people have used spreadsheets in their research?** - Rick: Als ik snel iets wil bekijken! - Judith: veel gebruikt in onderzoek, met formules, voor de pre-processing **How many people have accidentally done something that made them frustrated or sad?** - Judith: Als onderzoeker heb ik met excel een probleem gehad met de invoer van de geboortedata van proefpersonen, het format (UK / US) was veranderd in een gedeeld document, waardoor ik de leeftijd van de proefpersonen niet goed kon berekenen, en allemaal handmatig moest aanpassen - Voorbeeld genetica: https://www.nature.com/articles/d41586-021-02211-4 ## Data formatting ### Data formatting problems ### Keeping track of your analyses ### Structuring data in spreadsheets Alle variabelen in een kolom Elke observatie een rij Geen cellen combineren Bewaar de ruwe data! Exporteer naar een csv **Opdracht:** We’re going to take a messy version of the SAFI data and describe how we would clean it up. 1. Download the [messy data](https://ndownloader.figshare.com/files/11502824). 1. Open up the data in a spreadsheet program. 1. Notice that there are two tabs. Two researchers conducted the interviews, one in Mozambique and the other in Tanzania. They both structured their data tables in a different way. Now, you’re the person in charge of this project and you want to be able to start analyzing the data. 1. With the person next to you, identify what is wrong with this spreadsheet. Discuss the steps you would need to take to clean up the two tabs, and to put them all together in one spreadsheet. **Important** Do not forget our first piece of advice, to create a new file (or tab) for the cleaned data, never modify your original (raw) data. After you go through this exercise, we’ll discuss as a group what was wrong with this data and how you would fix it. ### Findings - missing number als -99 (gaat mis als je getallen gaat optellen etc) - voetnoot in geel, daar kan computer niets mee - verschillende spelling van roof-type bijv mabatisloping en mabati_sloping en floortype bijvoorbeeld errth en earth - Misschien de opmaak met tabel randen? - Verschillende manier van opschrijven tussen Mozambique en Tanzania - Bij Mozambique wordt er meerdere informatiepunten in één cel geschreven - Niet alles in rijen - Kleurformatting in dwelling tabel (Mozambique) - Meerdere stukjes informatie in één kolom (Mozambique) - Geen eenduidige formatting in plots (Mozambique) - Aantal kolommen lifestocktabel kan worden verminderd (Tanzania) - niet één variabele per kolom, variabelen verdeeld over meerdere kolommen - Typefouten (errth/earth) - Onduidelijke tabelnamen/ - 3 tabelen in 1 sheet, met dezelfde key_id --> ik vroeg mij af, staan de - key_id's voor hetzelfde? ### Metadata - Standaarden - Codebooks - [DDI]() - https://frictionlessdata.io/ -- https://lov.linkeddata.es/dataset/lov/ -wat zou een goede meta data bescrhijving zijn voor deze set (vraag Tineke) **Opdracht** Download a [clean version of this dataset](https://ndownloader.figshare.com/files/11492171) and open the file with your spreadsheet program. This data has many more variables that were not included in the messy spreadsheet and is formatted according to tidy data principles. Discuss this data with a partner and make a list of some of the types of metadata that should be recorded about this dataset. It may be helpful to start by asking yourself, “What is not immediately obvious to me about this data? What questions would I need to know the answers to in order to analyze and interpret this data?” ### Findings - Uitleg van variabelenamen - wat is in 'room' (incl. of excl. 'barn')? Wat is bedoeld met 'affect_conflicts'? Etc. - Vreemd formaat van de tijd-datum - Meer key-ids dan regels - somige data valt uit? ## Dates as data **Opdracht** > Download and open the [SAFI_dates.xlsx](https://ndownloader.figshare.com/files/11502827) file. This file > contains a subset of the data from the SAFI interviews, including the dates on which the > interviews were conducted. > > Choose the tab of the spreadsheet that corresponds to the way you format dates in your > location (either day first `DD_MM_YEAR`, or month first `MM_DD_YEAR`). > > Extract the components of the date to new columns. For this we > can use the built in Excel functions: > > `=MONTH()` > `=DAY()` > `=YEAR()` > > Apply each of these formulas to its entire column. > Make sure the new column is formatted as a number and not as a date. > > We now have each component of our date isolated in its own column. This will allow us > to group our data with respect to month, year, or day of month for our analyses and will > also prevent problems when passing data between different versions of spreadsheet > software (as for example when sharing data with collaborators in different countries). ```=DAY([@[interview_date]])``` ## Quality assurance Looking again at the [clean version of the SAFI dataset](https://ndownloader.figshare.com/files/11492171), we see that there are several columns with numeric data. One example of this is the column `no_membrs` representing the number of people in the household. We would expect this always to be a positive integer, and so we should reject values like `1.5` and `-8` as entry errors. We would also reject values over a certain maximum - for example an entry like `90` is probably the result of the researcher inputting `9` and their finger slipping and also hitting the `0` key. It is up to you as the researcher to decide what a reasonable maximum value would be for your data, here we will assume that there are no families with greater than 30 members. **Opdracht** > Apply a new data validation rule to one of the other numeric > columns in this data table. Discuss with the person sitting next > to you what a reasonable rule would be for the column you've selected. Be sure to create an informative input message. ## Exporting data To save a file you have opened in Excel in CSV format: 1. From the top menu select `File` and `Save as`. 2. In the `Format` field, from the list, select `Comma Separated Values` (`*.csv`). 3. Double check the file name and the location where you want to save it and hit `Save`. Note: selecting and exporting in UTF-8 file format ensures all special characters will be corectly saved. # OpenRefine Data: https://ndownloader.figshare.com/files/11502815 * Data is often very messy. OpenRefine provides a set of tools to allow you to identify and amend the messy data. * It is important to know what you did to your data. Additionally, journals, granting agencies, and other institutions are requiring documentation of the steps you took when working with your data. With OpenRefine, you can capture all actions applied to your raw data and share them with your publication as supplemental material. * All actions are easily reversed in OpenRefine. * If you save your work it will be to a new file. OpenRefine always uses a copy of your data and _does not_ modify your original dataset. * Data cleaning steps often need repeating with multiple files. OpenRefine keeps track of all of your actions and allows them to be applied to different datasets. * Some concepts such as clustering algorithms are quite complex, but OpenRefine makes it easy to introduce them, use them, and show their power. **Opdracht** > 1. Using faceting, find out how many different `interview_date` values there are in the survey results. > > 2. Is the column formatted as Text or Date? > > 3. Use faceting to produce a timeline display for `interview_date`. You will need to use `Edit cells` > `Common transforms` > `To date` to convert this column to dates. > > 4. During what period were most of the interviews collected?

    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