Main content

Files | Discussion Wiki | Discussion | Discussion
default Loading...

Home

Menu

Loading wiki pages...

View
Wiki Version:
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: 1. If you do not have Python v3 installed locally, download Anaconda and [follow these instructions to setup a Python v3 environment.][1] 2. Download the entire directory to your local hard disk 2. Unzip the contents of the directory. 3. 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 `<br> `#saveIntermed <- FALSE ` <br> 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) <br> 5. Run [Spectral_encoding_trim.py][5] 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* <br> 6. Run [Spectral_encoding_trim.py][6] 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) <br> 7. Run [Spectral_encoding_trim.py][7] 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) <br> 8. Source the [2_mec1_clean_step2.R][8] 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][9]) 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][10] together with [MEC_SASpreproc_all_updated][11]) 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. ---------- [1]: https://conda.io/docs/py2or3.html#create-a-python-3-5-environment "Anaconda Python v3" [2]: https://osf.io/qyd48/files/ "All Files" [3]: https://mfr.osf.io/export?url=https://osf.io/xz7n5/?action=download%26direct%26mode=render&initialWidth=665&childId=mfrIframe&format=1200x1200.jpeg [4]: https://osf.io/gmwv5/ [5]: https://osf.io/yzdu3/ [6]: https://osf.io/xcp7u/ [7]: https://osf.io/tfmgd/ [8]: https://osf.io/8yhzs/ [9]: https://osf.io/gbf5c/ [10]: https://osf.io/ndj48/ [11]: https://osf.io/ynf9q/
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.