Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Project directory organization and script naming conventions for research
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 63% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 58% | 0% |
This document outlines the standardized structure for research project code organization. Use this as a template for organizing future research projects.
Project Root/
├── Code/ # All analysis scripts
│ ├── [Numbered]_[Descriptive].py # Data processing scripts (Python)
│ ├── AN_[Number]_[Descriptive].py # Analysis scripts (Python)
│ ├── AN_[Number]_[Descriptive].do # Analysis scripts (Stata)
│ ├── LogFiles/ # Stata log files
│ └── README.md # Project documentation
├── Data/ # All data files
│ ├── Raw/ # Original, unprocessed data
│ ├── Intermediate/ # Partially processed data
│ └── Clean/ # Final, analysis-ready datasets
└── Results/ # Analysis outputs
├── Tables/ # Regression tables, summary stats
└── Figures/ # Plots, charts, visualizationsFormat: [Number]_[DescriptiveName].py
Examples:
0_ExtractCreditAgreements.py1a_CleanCompAnnualCRSP.py1b_ProcessDealscanCompustat.py2_MergeAgreementsCompCRSP.py3a_ExtractLoanOfficerNames.py4a1_ExtractLoanTerms.py4b_CleanLoanOfficerPanel.pyNumbering Logic:
Python Analysis Scripts:
AN_[Number]_[DescriptiveName].pyAN_1a_DescribeSample.pyAN_1b_DescribeSample_NoLinkedin.pyAN_1c_DescribeSample_Dealscan_Aggregated.pyStata Analysis Scripts:
AN_[Number]_[DescriptiveName].doAN_2a_MainRegressions_ChatGPT.doAN_2b_MainRegressions_ChatGPT_NoLinkedin.doAN_2c_MainRegressions_Dealscan_NoLinkedin.doAN_2d_MainRegressions_Dealscan_NoLinkedin_Aggregated.doAN_2e_MainRegressions_Dealscan_Secured.doAN_2f_MainRegressions_Dealscan_Covenants.doAnalysis Numbering Logic:
Standard Structure:
python""" [Script Name] [Brief Description] [Detailed description of what the script does] """ import pandas as pd import numpy as np from pathlib import Path # Other imports as needed def get_project_root(): """Automatically detect the project root directory.""" return Path(__file__).parent.absolute() def [main_function](): """Main processing function.""" # Script logic here pass if __name__ == "__main__": [main_function]()
Key Features:
get_project_root() function for path managementStandard Structure:
stata/*********** Globals for Paths ***********/ *** Change repodir and overleafdir paths for different users global repodir "/path/to/project/root" global datadir "$repodir/Data" global rawdir "$datadir/Raw" global cleandir "$datadir/Clean" global tabdir "$repodir/Results/Tables" global figdir "$repodir/Results/Figures" global logdir "$repodir/Code/LogFiles" * Start logging log using "$logdir/[ScriptName].log", replace /*********** [Analysis Section] ***********/ * Analysis code here * Close log file log close
Key Features:
Standard Structure:
python""" [Script Name] [Brief Description] This script [detailed description] based on the analysis in [corresponding Stata do file] """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path def get_project_root(): """Automatically detect the project root directory.""" return Path(__file__).parent.absolute() def load_data(): """Load the cleaned data.""" # Data loading logic pass def [analysis_function](): """Perform specific analysis.""" # Analysis logic pass def main(): """Main analysis function.""" # Orchestrate all analyses pass if __name__ == "__main__": main()
loan_officer_final_panel_chatgpt_cleaned.csvdealscan_merged_tranche_level.csvcomp_crspa_merged.csvRaw Data → Intermediate Processing → Clean Data → Analysis
(Scripts 0-4) (Scripts AN_1-AN_4)Use descriptive suffixes for different versions:
_ChatGPT.py (uses ChatGPT-extracted data)_NoLinkedin.py (excludes LinkedIn variables)_Dealscan.py (uses Dealscan data)_Aggregated.py (uses aggregated data)get_project_root() for Python scriptsFor a new research project, create this structure:
NewProject/
├── Code/
│ ├── 0_ExtractRawData.py
│ ├── 1a_CleanDatasetA.py
│ ├── 1b_CleanDatasetB.py
│ ├── 2_MergeDatasets.py
│ ├── 3_ExtractFeatures.py
│ ├── 4_PrepareAnalysisData.py
│ ├── AN_1a_DescribeSample.py
│ ├── AN_2a_MainRegressions.do
│ ├── AN_2b_RobustnessTests.do
│ ├── LogFiles/
│ └── README.md
├── Data/
│ ├── Raw/
│ ├── Intermediate/
│ └── Clean/
└── Results/
├── Tables/
└── Figures/This structure ensures:
Other measured skills in the registry, with their headline benchmark lift.