ABSTRACT

This chapter provides information on recoding and transforming variables. For data frames with more than a few variables and observations this is very impractical. The head command shows the names plus the first few observations in a data frame. The summary command is especially helpful for seeing basic descriptive statistics for all of the variables in a data frame and also the variables’ types. The chapter also provides examples of time-series cross-sectional data (TSCS) that we want to have in long-format. Long formatted TSCS data is simply a data frame where rows identify observations of a particular subject at particular points in time and there are multiple observations per subject. Tidying data is often the cause of much confusion and frustration.