ABSTRACT

This chapter deals with programming of one or more data sets to construct a final data set for a particular analysis. Adding new observations to a data set using SET statements or new variables to a data set using MERGE operations are then illustrated. SQL procedure statements are used to mimic these operations. Additional preparation of a data set may require reshaping it from a wide to a long format or from a long to a wide format. This chapter concludes with an illustration of constructing training and validation data sets.