There is a lot of skill needed to perform good data analyses. It is not just about statistical knowledge (though more statistical knowledge is always helpful). Organizing your data analysis, and knowing how to do that, is a key skill.
One of my favorite funny lines is “Computers are faster, they just take longer.” It can take more time to implement best practices, but it’s worthwhile. There may be a start-up cost (writing the code) but it saves a lot of time and aggravation down the analysis road.
One thing to keep in mind. Data analysis is not a linear process, it’s an iterative one. It’s not a cookbook recipe where you just go down the list of ingredients. It’s more like you run your first model and the results mean you need a different model. That doesn’t mean you’re doing it wrong. That’s just how it works.
Here are a few pointers for organizing your data analysis I’ve discovered through many years of analyzing data.
1. Once you have your data, the first step is data preparation.
Don’t skip this.
Preparation includes cleaning the data for errors, formatting the variables, creating new variables, and setting up the data set for the analysis.
It’s always a good idea to add a lot of comments to any syntax. Yes, use syntax and not menus for everything. Or at least paste the syntax, even if you use menus to generate it. I learned the hard way – never sort or recode in an Excel file. You have no history of what you did. Tiny errors can cause big problems.
2. Take the time to include variable and value labels.
It makes it so much easier to read your output if it displays what each variable measures and what category each code represents. Don’t waste time going back to your notes again and again to remember what the number code means.
3. Perform descriptive statistics and graphs next.
Descriptive statistics and graphs are not just important, they are necessary. Why? First, they’ll help you catch any remaining issues in data cleaning. Second, they’ll help you understand what you’re working with. Knowing how each variable is distributed can help you tweak your analysis plan. And third, they will serve as a warning for potential issues that might come up later once you check assumptions.
4. Keep a version history of all files.
This will help you keep track of the ‘what and when’ of any changes. A good tip is to name and date your syntax and output files the same.
And, as I’m sure you know, always back up your files.
5. Have separate files for each procedure and outcome.
Having separate smaller files makes it easier to find a particular analysis later. But I have found a flip side to this. As you do more analyses you may find new and better ways to perform them. One file (with separate blocks for each outcome) can be easier for making global changes. If you have separate files, take the time to go back and update all the code. You will be glad you did.
6. Open your data and save output with syntax commands.
If you’re working with a software package in which data sets, syntax, and output are separate files, it can be difficult to track which files go together.
If the first command in your syntax opens the correct data file and the last command saves the output to a specific name, you can always tell where that output came from and which data it was based off.
7. Write as you go.
When you are running your descriptive statistics, put together your tables. This will help you see patterns and gaps in the data and in what you have done. Some people like to wait to clean the kitchen until finished cooking. I recommend cleaning-up as you go.
8. Summarize results of multiple models in one table.
One source of frustration can be forgetting what you have already done. Here again, tables are your friend. If you have run several different models, putting together a summary table will help you (I do it in Excel).
9. Find a strategy for organizing your data analysis and stick to it.
Take what works for you from the suggestions above. There are many good strategies and ways to organize that work. The most important practice is to pick a strategy and use it.