Chapter 28 Why Use Computers?
Analysis tools like Excel, Stata and R offer an enormous range of features and commands. When working with these programs, there are typically many ways to solve the same problem. There is rarely a single right answer about which method is best — it depends on the task, the context, and the user.
The aim here is to get you started quickly and equip you to learn more on your own. This text is deliberately brief and does not aim for depth. The instructions are best understood as examples of how the programs can be used. As you gain experience, you will soon discover other approaches to the problems covered here.
No advanced prior knowledge of computers, analysis programs, mathematics, or statistics is required. Basic computer literacy is assumed, including familiarity with concepts such as hard drive, memory, and files, as well as how to download and save files from the internet.
Keyboard shortcuts are used throughout. On Windows, the Ctrl key is commonly used; the equivalent on Mac is the CMD key.
28.1 Three Analytical Tools
Each tool is introduced through similar examples covering:
- Saving and editing information, primarily by working with data organized in tables.
- Importing and exporting information from and to files on the hard drive.
- Mathematical operations and commands for working with matrices.
- Describing quantitative data using measures of central tendency and dispersion.
- Commands for calculating probabilities with common probability distributions.
- Creating charts and graphics to illustrate data and mathematical functions.
- Commands for basic regression analysis.
Microsoft Excel is part of the Microsoft Office suite. First released in 1985, Excel is today a versatile spreadsheet and data analysis program. It is one of the most widely installed applications in the world, used across organizations of all kinds for analytical work and many other purposes.
Stata is widely used for statistical analysis at universities, government agencies, and private companies. First released in 1985, it is today one of the world’s best-known analysis programs. Stata is developed by StataCorp (www.stata.com).
R is a programming language designed for statistical analysis and other purposes. First introduced in the 1990s, R has since become one of the world’s most popular programming languages. Unlike Excel and Stata, R is open source and available as a free download.
All three tools offer far more functionality than we can cover here. Each also supports add-ons and extensions that can be downloaded free of charge. For Stata and R in particular, users routinely create and share their own functions, which rapidly expands what the programs can do.
Many people have strong opinions about which program, tool, or method is best. Such debates are often unproductive. The right choice depends on the task, the objectives, available resources, and other factors — and often the best program is simply the one you are most comfortable with.
That said, there are good reasons to become proficient with more than one tool. Different programs have distinct strengths and weaknesses. Sometimes a particular tool offers an unusually elegant solution to a specific problem. Familiarity with different tools can spark new ideas and suggest better solutions. And sometimes you simply have to use a program because everyone else in your organisation does.
Once comfortable with a tool, it is easy to stop there. But computers and software evolve constantly, and it is worth keeping an open mind and periodically investing time in learning something new.
28.2 Programming: Why Bother?
Much of this book is devoted to written commands and programming code for Stata and R. For readers unfamiliar with programming, this may seem unnecessarily complex. That said, most programs require only a few hours to get started. Once you grasp the underlying logic, learning new solutions becomes straightforward. In data analysis, knowing around 20 core commands is usually enough to handle most tasks, and additional commands can be looked up as needed. Programming languages for data analysis also share many similarities, so once you know one, picking up another becomes much easier.
Computers are especially useful for at least two types of analytical work:
- Complex tasks: intricate calculations that would be impractical to carry out by hand.
- Repetitive tasks: performing the same operation many times, or finding every instance of a word in a large text.
Most work involves more repetition than it first appears — similar tasks arise again and again. Identifying which tasks repeat is itself an important part of the work. The more skilled you become with analysis tools, the better you get at recognising where a computer can help.
Beyond the technical, programming is an excellent way to document your work, which matters for several reasons. Data projects often involve substantial preparation before any results are produced: correcting errors, reformatting data, adding columns, merging tables. Every step carries the risk of a mistake, and with large datasets those mistakes are easy to miss. When all steps are written as code, errors are far easier to find and fix.
28.3 You Have to Practice
Learning to use a computer program cannot be done by reading alone. You need to spend time working independently, encountering problems, and making mistakes. To get the most from this book, follow the examples and work hands-on with the programs.
Most programs include built-in help resources. The internet offers a wealth of additional material: exercises, tutorials, videos, free textbooks, and more. AI tools can also help generate code and suggest which functions to use for specific problems.
Many programs are designed to let users create and share their own functions freely online. This means the range of available commands is constantly growing. All programs are also regularly updated by their developers.