Files | Discussion Wiki | Discussion | Discussion

default Loading...

Home

Menu

Loading wiki pages...

View
Wiki Version:
<h2>Data Preprocessing & Analysis</h2> <p>This page describes the steps for preprocessing and analyzing the data for this project. </p> <hr> <h4>Preprocessing</h4> <p>Follow these simple steps to preprocess data:</p> <ol> <li>If you do not have Python v3 installed locally, download Anaconda and <a href="https://conda.io/docs/py2or3.html#create-a-python-3-5-environment" rel="nofollow" title="Anaconda Python v3">follow these instructions to setup a Python v3 environment.</a> </li> <li>Download the entire directory to your local hard disk</li> <li>Unzip the contents of the directory.</li> <li> <p>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. </p> <p><code>saveIntermed &lt;- TRUE</code><br> <code>#saveIntermed &lt;- FALSE</code></p> </li> </ol> <p><br> 4. Source the <a href="https://osf.io/gmwv5/" rel="nofollow">1_mec1_clean_step1.R</a> file located in <strong>Rscripts</strong>. Or type these commands into R or RStudio. </p> <pre class="highlight"><code> setwd(&quot;~/Downloads/mec_osfPipeline/Rscripts&quot;) #or wherever you saved your directory source(1_mec1_clean_step1.R) (This script should take ~15 minutes to run)</code></pre> <p><br></p> <ol> <li> <p>Run <a href="https://osf.io/yzdu3/" rel="nofollow">Spectral_encoding_trim.py</a> from the <strong>Dictionaries/moral_emo</strong> folder. For example, open Gitbash for Windows and run the following. </p> <p>source activate py35 cd ~/mec_osfPipeline/dictionaries/moral_emo python <a href="http://Spectral_encoding_trim.py" rel="nofollow">Spectral_encoding_trim.py</a></p> </li> </ol> <p>(This script should take ~40 minutes to run) </p> <p><em>Tip: you can run steps 5-7 in separate command line windows to run in parallel</em></p> <p><br></p> <ol> <li> <p>Run <a href="https://osf.io/xcp7u/" rel="nofollow">Spectral_encoding_trim.py</a> from the <strong>Dictionaries/moral_emo_pos</strong> folder. For example, open Gitbash for Windows and run the following. </p> <p>source activate py35 cd ~/mec_osfPipeline/dictionaries/moral_emo_pos python <a href="http://Spectral_encoding_trim.py" rel="nofollow">Spectral_encoding_trim.py</a></p> </li> </ol> <p>(This script should take ~40 minutes to run)</p> <p><br></p> <ol> <li> <p>Run <a href="https://osf.io/tfmgd/" rel="nofollow">Spectral_encoding_trim.py</a> from the <strong>Dictionaries/moral_emo_neg</strong> folder. For example, open Gitbash for Windows and run the following. </p> <p>source activate py35 cd ~/mec_osfPipeline/dictionaries/moral_emo_neg python <a href="http://Spectral_encoding_trim.py" rel="nofollow">Spectral_encoding_trim.py</a></p> </li> </ol> <p>(This script should take ~40 minutes to run)</p> <p><br> </p> <ol> <li>Source the <a href="https://osf.io/8yhzs/" rel="nofollow">2_mec1_clean_step2.R</a> file located in <strong>Rscripts</strong>. Or type these commands into R or RStudio. <pre class="highlight"><code>setwd(&quot;~/Downloads/mec_osfPipeline/Rscripts&quot;) #or wherever you saved your directory source(2_mec1_clean_step2.R)</code></pre> <p>(This script should take ~30 seconds to run)</p> </li> </ol> <hr> <h4>Analysis</h4> <p>You can use SAS or R to explore and analyze the preprocessed files (e.g., <a href="https://osf.io/gbf5c/" rel="nofollow">MEC_SASpreproc_Marriage.csv</a>) located in the <strong>Cleaned Data</strong> folder. </p> <p>However, if you want to follow along with our analysis scripts, be sure to check out the <strong>SAS Scripts</strong> 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 <a href="https://osf.io/ndj48/" rel="nofollow">All.sas</a> together with <a href="https://osf.io/ynf9q/" rel="nofollow">MEC_SASpreproc_all_updated</a>)</p> <p>The data files in the <strong>Cleaned Data</strong> 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.</p> <hr>
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.