Difference between revisions of "Iefolder"

Jump to: navigation, search
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<code>iefolder</code> sets up project folders and master do-files according to World Bank DIME's standards. It automates the process of setting up the folders and master do-files where all the data work will take place in a project folder. The folders set up will follow DIME's best practices outlined and explained in [[DataWork Folder]]
<onlyinclude>
<code>iefolder</code> is a Stata command within <code>[[ietoolkit]]</code>. It sets up the [[DataWork_Folder|DataWork folder]], a standardized project folder structure for [[Reproducible Research | reproducible research]]. In addition to setting up the DataWork folder, <code>iefolder</code> creates [[Master Do-files | master do-files]] linking to all main folders in the folder structure. These master do-files are updated whenever more rounds, units of observations, and subfolders are added to the project folder using this command. It is important to use <code>iefolder</code> at the beginning of a research project in order to employ the DataWork folder throughout the entire project.  
</onlyinclude>
==Read First==
*To install all commands in <code>ietoolkit</code>, including <code>iefolder</code>, type <code>ssc install ietoolkit</code> in Stata.
*For instructions on how to use <code>iefolder</code> and for a complete list of available options, type <code>help iefolder</code> in Stata.
*For more information on the folder structure that <code>iefolder</code> sets up, see [[DataWork Folder]]


In addition to setting up the '''DataWork''' folder and its sub-folders, the 
== Instructions ==
command creates master do-files linking to all of these sub-folders. These 
master do-files are updated whenever more subfolders are added using this command.


===itemtypes===  
===Setting up===
This command can create either a new DataWork folder or add folders to an 
To set up the DataWork folder and the main [[Master Do-files | master do-file]], specify <code>new project</code>. For the command to work properly, do not change the name of this folder or do-file.  
existing DataWork folder. The existing DataWork folder must have been created  with <code>iefolder</code> for the additions to work. There are two types of folders that can be added to an existing folder, ''round'' and ''untiofobs''.
# round folders :
folders specific to a data collection round, for example, ''Baseline'', ''Endline'', ''Follow Up'' etc. When adding a new round, sub-folders are added to the DataWork  folder in line with the best practice described in [[DataWork_Survey_Round]]. <code>iefolder</code> also creates a master do-file specific for this round with globals referencing the sub-folders specific to this round. <code>iefolder</code> is implemented so that you can keep working for years with your project in between adding folders. The command reads and preserves changes made manually to the DataWork folder and master do-file before making additions when adding a new round.  


#unitofobs folders :
<pre>
folders specific to a unit of observation, for example the master data set folder. Read more about master data sets and the folder structure in [[Master_Data_Set]]. A master data folder for each new unit of observation is created in two places. Both in the MasterData folder in the DataWork folder, and in the MasterKeyID folder in the encrypted folder.
global folder "C:\Users\username\DropBox\ProjectABC" //Update this to your folder
iefolder new project, projectfolder("$folder")
</pre>
 
===Adding folders===
To add folders to an already existing DataWork folder, specify <code>unitofobs</code>, <code>round</code>, and/or <code>subfolder</code>, depending on the folder you wish to create. Note that you do not have to create all these folders immediately when you set up the project folder. You may add them as the need arises throughout the project.
 
====Unit of Observation Folders====
Unit of Observation folders provide a place to store master data for different units of observation. <code>unitofobs</code> creates a master data folder for each new unit of observation in two places: in the MasterData folder and the Encrypted folder.
 
<pre>
global folder "C:\Users\username\DropBox\ProjectABC" //Update this to your folder
 
//Create a place to store all time invariant data on households and clinics
iefolder new unitofobs households, projectfolder("$folder")
iefolder new unitofobs clinics, projectfolder("$folder")
</pre>
 
====Round Folders====
Round folders are specific to a data collection round (baseline, endline, follow-up, etc.). When adding a new round, <code>round</code> adds a round folder to the DataWork folder that follows the [[DataWork Survey Round]] structure; it contains a Datasets folder, Dofiles folder, Outputs folder, Documentation folder and Questionnaire folder. Each round folder contains a master do-file that references the main folders in the folder structure specific to the round. Whenever you create a new round folder, <code>iefolder</code> creates a partner folder for each round in the Survey Encrypted Data folder.
 
====Subfolders====
Subfolders are single, empty folders within a parent folder. <code>subfolder</code> updates the master do-file with a global to the new folder. This is useful if, for example, you collected data on multiple [[Unit of Observation | units of observation]] in a given survey round. Imagine that your project has baseline data collection for students, teachers, and schools. In this case, you could use <code>subfolder</code> to create an empty Baseline folder and within the subfolder, use <code>round</code> to create Baseline folders for students, teachers and schools.
 
<pre>
//Create a subfolder for all baseline rounds
iefolder new subfolder baseline, projectfolder("$folder")
 
//Create a folder for each data collection activity, see that they are organized into the subfolder
iefolder new round farmer_baseline, projectfolder("$folder") subfolder(baseline)
iefolder new round clincs_baseline, projectfolder("$folder") subfolder(baseline)
</pre>
 
== Back to Parent ==
This article is part of the topic [[Stata_Coding_Practices#ietoolkit|ietoolkit]]
==Additional Resources==
*DIME Analytics’ guidelines on [https://github.com/worldbank/DIME-Resources/blob/master/stata1-3-cleaning.pdf Data Management and Cleaning]
*DIME Analytics’ guidelines on [https://github.com/worldbank/DIME-Resources/blob/master/stata2-3-data.pdf Data Management for Reproducible Research]
*DIME Analytics' guidelines on [https://github.com/worldbank/DIME-Resources/blob/master/welcome-iefolder.pdf iefolder]
[[Category: Reproducible Research]]

Latest revision as of 14:21, 13 April 2021

iefolder is a Stata command within ietoolkit. It sets up the DataWork folder, a standardized project folder structure for reproducible research. In addition to setting up the DataWork folder, iefolder creates master do-files linking to all main folders in the folder structure. These master do-files are updated whenever more rounds, units of observations, and subfolders are added to the project folder using this command. It is important to use iefolder at the beginning of a research project in order to employ the DataWork folder throughout the entire project.

Read First

  • To install all commands in ietoolkit, including iefolder, type ssc install ietoolkit in Stata.
  • For instructions on how to use iefolder and for a complete list of available options, type help iefolder in Stata.
  • For more information on the folder structure that iefolder sets up, see DataWork Folder

Instructions

Setting up

To set up the DataWork folder and the main master do-file, specify new project. For the command to work properly, do not change the name of this folder or do-file.

global folder "C:\Users\username\DropBox\ProjectABC" //Update this to your folder
iefolder new project, projectfolder("$folder")

Adding folders

To add folders to an already existing DataWork folder, specify unitofobs, round, and/or subfolder, depending on the folder you wish to create. Note that you do not have to create all these folders immediately when you set up the project folder. You may add them as the need arises throughout the project.

Unit of Observation Folders

Unit of Observation folders provide a place to store master data for different units of observation. unitofobs creates a master data folder for each new unit of observation in two places: in the MasterData folder and the Encrypted folder.

global folder "C:\Users\username\DropBox\ProjectABC" //Update this to your folder

//Create a place to store all time invariant data on households and clinics
iefolder new unitofobs households, projectfolder("$folder")
iefolder new unitofobs clinics, projectfolder("$folder")

Round Folders

Round folders are specific to a data collection round (baseline, endline, follow-up, etc.). When adding a new round, round adds a round folder to the DataWork folder that follows the DataWork Survey Round structure; it contains a Datasets folder, Dofiles folder, Outputs folder, Documentation folder and Questionnaire folder. Each round folder contains a master do-file that references the main folders in the folder structure specific to the round. Whenever you create a new round folder, iefolder creates a partner folder for each round in the Survey Encrypted Data folder.

Subfolders

Subfolders are single, empty folders within a parent folder. subfolder updates the master do-file with a global to the new folder. This is useful if, for example, you collected data on multiple units of observation in a given survey round. Imagine that your project has baseline data collection for students, teachers, and schools. In this case, you could use subfolder to create an empty Baseline folder and within the subfolder, use round to create Baseline folders for students, teachers and schools.

//Create a subfolder for all baseline rounds 
iefolder new subfolder baseline, projectfolder("$folder")

//Create a folder for each data collection activity, see that they are organized into the subfolder
iefolder new round farmer_baseline, projectfolder("$folder") subfolder(baseline)
iefolder new round clincs_baseline, projectfolder("$folder") subfolder(baseline)

Back to Parent

This article is part of the topic ietoolkit

Additional Resources