How to show top head and tail of dataset in Stata

How to show top head and tail of dataset in Stata.

In Stata we can show the head and tail of dataset using the command list in.

For example we use the auto.data dataset and we want to know what does the first 5 observations and last 5 observation look like? Let's...

sysuse auto, clear

list in 1/5

list in 1/5

And if we want to show the last 5 observations we just use this command:

list in -5/-1

list in -5/-1

We can show only variable(s) we need as well.

list make price weight length foreign in 1/5

list make price weight length foreign in 1/5

And show the last 5 observations with target variable(s).

list make price weight length foreign in -5/-1

list make price weight length foreign in -5/-1

We can apdapted the command to fit our need.

list make price weight length foreign in 5/10

list make price weight length foreign in 5/10
list make price weight length foreign in -10/-1
list make price weight length foreign in -10/-1

Please enjoy your turn.

Comments