Path Analysis | Stata FAQ

It is not very difficult to perform path analysis using Stata’s regress command, but it
does require the use of a regress command for each stage in the path analysis model. pathreg
is a convenience command that can compute the path analysis with a single command.
You can download pathreg over the internet by typing search
pathreg (see
How can I used the search command to search for programs and get additional
help? for more information about using search).

Let’s say that we want to estimate the following path model using the hsb2 dataset.

We will begin by downloading the data over the internet and getting the correlation between
the two exogenous variables, read and write.

This path analysis is really just two regression models. The first model is
math = _cons + read + write while
the second model is science = _cons + math + read + write. Using pathreg we just
place each model inside parentheses (leaving off the equal signs, plus signs and constants).