Difference between revisions of "Iefolder"

Jump to: navigation, search
Line 1: Line 1:
<onlyinclude>
<onlyinclude>
'''iefolder''' is used to set up standardized project folder structures with master do-files and to add to them as the project expands.
<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 run <code>iefolder</code> at the beginning of a research project in order to use the DataWork folder throughout the entire project. This page describes use cases and work flow.
</onlyinclude>
</onlyinclude>
This article is meant to describe use cases, work flow and the reasoning used when developing the commands. For instructions on how to use the command specifically in Stata and for a complete list of the options available, see the help files by typing <code>help iefolder</code> in Stata. This command is a part of the package [[Stata_Coding_Practices#ietoolkit|ietoolkit]], to install all the commands in this package including this command, type <code>ssc install ietoolkit</code> in Stata.
==Read First==
 
*To install all commands in <code>ietoolkit</code>, including  <code>iefolder</code>, type <code>ssc install ietoolkit</code> in Stata.
== Intended use cases ==
* To create more subfolders within the DataWork folder as the project moves forward, use the <code>iefolder</code> command in Stata.
This command is intended to set up folder structure for a new project. The folder structure template used by this command is DIME's folder structure template described in the [[DataWork_Folder|DataWork folder]] page. Our strong recommendation is that all organizations should have a standardized folder structure, and that all individual projects should set up their own or someone else's standardized folder structure, but this structure can of course differ in many ways compare to DIME's folder structure. ''iefolder'' makes it easy to set up DIME's standardized folder structure in a new project.
*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]]
''iefolder'' also makes it easy to add folders as needed to project folders that was initially set up by ''iefolder'' as the project moves forward and need more sub-folders. See more details in the work flow section below.


== Instructions ==
== Instructions ==
These instructions are meant to help you understand how to use the command. For technical instructions on how to implement the command in Stata see the help files by typing <code>help iefolder</code> in Stata.
At the start of project, iefolder is used to set up the project folder based on [[DataWork_Folder|DIME's project folder template]]. See the link for a detailed description of the folder structure, this article will focus on how to use the command.


The first time you set up a project folder you use the <code>new project</code> to set up the top folder ''DataWork'' and the main master do-file. For the command to work properly you may not change the name of this folder or do-file. You set the project up like this:
===Setting up===
To set up the DataWork folder and the main [[Master Do-files | master do-file]], use <code>new project</code>. For the command to work properly, do not change the name of this folder or do-file.  


<pre>
<pre>
Line 20: Line 18:
</pre>
</pre>


After you have created the project folder you can use iefolder add the folders to the project folder according to the need of your project. The type of folders you can add is ''unit of observation'' folder, ''round'' foulder and ''subfolder'' folder.
===Adding folders===
To add folders to an already existing DataWork folder, use the <code>subfolder</code>, <code>round</code>, and/or <code>unitofobs</code> options, depending on the folder you wish to create.
 
Unit of Observation folders provide a place to store master data for different units of observation. This <code>unitofobs</code> option creates a master data folder for each new unit of observation in two places: in the MasterData folder and the Encrypted folder.


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


//Create a place where to store all time invariant data on households and clinics
//Create a place to store all time invariant data on households and clinics
iefolder new unitofobs households, projectfolder("$folder")
iefolder new unitofobs households, projectfolder("$folder")
iefolder new unitofobs clinics, projectfolder("$folder")
iefolder new unitofobs clinics, projectfolder("$folder")
</pre>
Round folders are specific to a data collection round (baseline, endline, follow-up etc.). When adding a new round, the <code>round</code> option 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 are a single, empty folders within a parent folder. The <code>subfolder</code> option 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. For example, a project may have 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.


//Create a subfolder for all baseline rounds can be organized
<pre>
//Create a subfolder for all baseline rounds  
iefolder new subfolder baseline, projectfolder("$folder")
iefolder new subfolder baseline, projectfolder("$folder")


Line 37: Line 43:
</pre>
</pre>


Note that you do not have to create all these folders at the time when the project folder is set up in the first place. You can add these folders as the need arise throughout the duration of the project. Remember to not change the names of the folders or master do-files that iefolder creates as the command might not work as intended then.
Note that you do not have to create all these folders at the time when the project folder is set up in the first place. You can add these folders as the need arises throughout the duration of the project. Remember to not change the names of the folders or master do-files that <code>iefolder</code> creates as the command might not work as intended then.
 
== Reasoning used during development ==
The decisions in this command follows the decisions made when developing the DIME's folder structure template described in the [[DataWork_Folder|DataWork folder]] page. See that page for more details.
 
== Back to Parent ==
== Back to Parent ==
This article is part of the topic [[Stata_Coding_Practices#ietoolkit|ietoolkit]]
This article is part of the topic [[Stata_Coding_Practices#ietoolkit|ietoolkit]]


[[Category: Stata ]]
[[Category: Stata ]]

Revision as of 17:02, 23 April 2019

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 run iefolder at the beginning of a research project in order to use the DataWork folder throughout the entire project. This page describes use cases and work flow.

Read First

  • To install all commands in ietoolkit, including iefolder, type ssc install ietoolkit in Stata.
  • To create more subfolders within the DataWork folder as the project moves forward, use the iefolder command 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, use 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, use the subfolder, round, and/or unitofobs options, depending on the folder you wish to create.

Unit of Observation folders provide a place to store master data for different units of observation. This unitofobs option 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 are specific to a data collection round (baseline, endline, follow-up etc.). When adding a new round, the round option 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 are a single, empty folders within a parent folder. The subfolder option 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. For example, a project may have 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)

Note that you do not have to create all these folders at the time when the project folder is set up in the first place. You can add these folders as the need arises throughout the duration of the project. Remember to not change the names of the folders or master do-files that iefolder creates as the command might not work as intended then.

Back to Parent

This article is part of the topic ietoolkit