Main content
Home
Menu
Data Preprocessing & Analysis
This page describes the steps for preprocessing and analyzing the data for this project.
Preprocessing
Follow these simple steps to preprocess data:
-
If you do not have Python v3 installed locally, download Anaconda and follow these instructions to setup a Python v3 environment.
-
Download the entire directory to your local hard disk
-
Unzip the contents of the directory.
-
The final .csv file will be outputted into the cleanedData directory, which is empty at first. You can also save intermediate files at each preprocessing stage by modifying the script as shown below.
saveIntermed <- TRUE
#saveIntermed <- FALSE
4. Source the [1_mec1_clean_step1.R][4] file located in **Rscripts**. Or type these commands into R or RStudio.
setwd("~/Downloads/mec_osfPipeline/Rscripts") #or wherever you saved your directory
source(1_mec1_clean_step1.R)
(This script should take ~15 minutes to run)
- Run Spectral_encoding_trim.py from the Dictionaries/moral_emo folder. For example, open Gitbash for Windows and run the following.
source activate py35
cd ~/mec_osfPipeline/dictionaries/moral_emo
python Spectral_encoding_trim.py
(This script should take ~40 minutes to run)
Tip: you can run steps 5-7 in separate command line windows to run in parallel
- Run Spectral_encoding_trim.py from the Dictionaries/moral_emo_pos folder. For example, open Gitbash for Windows and run the following.
source activate py35
cd ~/mec_osfPipeline/dictionaries/moral_emo_pos
python Spectral_encoding_trim.py
(This script should take ~40 minutes to run)
- Run Spectral_encoding_trim.py from the Dictionaries/moral_emo_neg folder. For example, open Gitbash for Windows and run the following.
source activate py35
cd ~/mec_osfPipeline/dictionaries/moral_emo_neg
python Spectral_encoding_trim.py
(This script should take ~40 minutes to run)
-
Source the 2_mec1_clean_step2.R file located in Rscripts. Or type these commands into R or RStudio.
setwd("~/Downloads/mec_osfPipeline/Rscripts") #or wherever you saved your directory source(2_mec1_clean_step2.R)
(This script should take ~30 seconds to run)
Analysis
You can use SAS or R to explore and analyze the preprocessed files (e.g., MEC_SASpreproc_Marriage.csv) located in the Cleaned Data folder.
However, if you want to follow along with our analysis scripts, be sure to check out the SAS Scripts folder, and use the scripts in there. Be sure to use the data files in the SAS scripts folder to prevent any import or incorrect variable name errors (e.g., use All.sas together with MEC_SASpreproc_all_updated)
The data files in the Cleaned Data folder are identical with the exception of some variable naming and removal of "NA"s for missing data that can cause errors in the SAS data import procedure.
Page permissions have changed
Your browser should refresh shortly…
Renaming wiki...
Wiki page deleted
Press Confirm to return to the project wiki home page.
Connected to the collaborative wiki
This page is currently connected to the collaborative wiki. All edits made will be visible to contributors with write permission in real time. Changes will be stored but not published until you click the "Save" button.
Connecting to the collaborative wiki
This page is currently attempting to connect to the collaborative wiki. You may continue to make edits. Changes will not be saved until you press the "Save" button.
Collaborative wiki is unavailable
The collaborative wiki is currently unavailable. You may continue to make edits. Changes will not be saved until you press the "Save" button.
Browser unsupported
Your browser does not support collaborative editing. You may continue to make edits. Changes will not be saved until you press the "Save" button.

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.
Copyright © 2011-2025
Center for Open Science
|
Terms of Use
|
Privacy Policy
|
Status
|
API
TOP Guidelines
|
Reproducibility Project: Psychology
|
Reproducibility Project: Cancer Biology