Selecting Observations – Where, If, Select If, Filter
It bears repeating that the approaches that R uses to select observations are, for the most part, the same as those discussed previously for selecting variables. This chapter focuses only on selecting observations. The examples and descriptions parallel the previous chapter as closely as possible. While some may view this as dull repetition, I view it as a helpful review of topics that will initially seem quite odd to SAS and SPSS users. It also allows you read each topic independently for future reference.
Selecting Observations in SAS and SPSS
There are many ways to select observations in SAS and SPSS and it is outside our scope to discuss them all here. However, we will look at one method for comparison purposes. For both SAS and SPSS, if you do not select observations, it assumes you want to analyze all the data. So in SAS:PROC MEANS;VAR workshop– –q4;RUN;will analyze all the observations. And in SPSS:DESCRIPTIVES VARIABLES=workshop TO q4.will also use all observations.
To select a...