Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
### Purpose of this repository This is a record of the code needed to reproduce the results presented in "[Gender differences in individual variation in academic grades fail to fit expected patterns for STEM](http://dx.doi.org/10.1038/s41467-018-06292-0)". The code works in conjunction with raw, processed, and imputed data, which can be downloaded from [the Data component](https://osf.io/efm9t/?view_only=0779be57fb8e48cb986126729051d56d). Here, the OSF storage contains four main folders: #### Analysis Contains custom functions and subfolders for three R markdown (.Rmd) files: 1. processing raw data 2. imputing missing data (age of students and study year) 3. analysing data Please note that our function for calculating the sampling variance for SMD (referred to as Hedge's g, or Hg, in the code) is incorrect - it actually calculates the standard error. Therefore, we square this column before analysis. Most analyses are run using the [metafor R package](http://www.metafor-project.org/doku.php). An alternative but similar approach, using the [robumeta R package](https://cran.r-project.org/web/packages/robumeta/robumeta.pdf), is documented in [the Robumeta component page](https://osf.io/ejqm4/?view_only=4c53bc91c2dd43879b0939827bf36fb3) Imputing data, and running models on imputed data, is computationally slow; these scripts are best run overnight. #### Figures The R markdown file "MA_STEP4_figures.Rmd" generates results figures presented in the main text and supplementary information (SI). Each figure is generated beneath its corresponding figure legend, in a separate chunk of code. All figures are saved in the subfolder "plots", but some require additional modifications in [ Illustrator](https://en.wikipedia.org/wiki/Adobe_Illustrator), or [Powerpoint](https://en.wikipedia.org/wiki/Microsoft_PowerPoint). The simulated data required to produce **Figure 3C** are a little slow (approximately 5 minutes), so they are saved as .Rdata files in the "plots" folder, too. #### Rdata Stores all the models as .Rdata files, which were either produced in the main analysis script, or in the [supplementary analysis of PISA data](https://osf.io/vu8h2/?view_only=b5131c883bd24b90919c4ea4944e93c5). These models are required for running the **Figures** and **Results Tables** code. #### Results Tables The R markdown file "Results Tables.Rmd" takes raw data (presented in the subfolder "Data"), model outputs (presented in the separate "Rdata" folder), and an Excel workbook ("Results Tables.xlsx"), to create the tables of results presented in the SI. Each table is created in a separate chunk of code, by importing the formatted table from the .xlsx file, and exporting the table as a .csv file to the subfolder "csv tables". The numbers from this table can then be pasted into the "Results Tables.xlsx" file, using '*Paste special...values*' to retain the original formatting. These tables are combined with the table titles by copying and pasting them into the knitted "Results Tables.docx" file. #### Results Text This folder contains the models, processed data, and R markdown file used to produce the Results section from the main text of the manuscript. To simplify the import process, all models and data are saved as one file - "models_main_text.Rdata".
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.