![]() ![]() However, in this case, we have a file that has the demographic information (called hsdem) and a file with the test scores (called hstest), and we wish to merge these files together. title Īgain, we have been given two files. We do this by listing both data file names on the set statement in the data step. In this example, we are adding cases, sometimes called “stacking” the data files. We need to combine these files together to be able to analyze them by gender, as shown below. In this example we start with two datasets, one for males (called hsmale) and one for the females (called hsfemale). Below we show how to remove the variables ses and prog from the dataset. Instead of wanting to keep just a handful of variables, we may want to get rid of just a handful of variables in our data file. We can subset our data file to keep just those variables as shown below. ![]() data highread lowread įurther suppose that our data file had many variables, say 2000 variables, but we only care about just a handful of them, id, female, read and write. Here we show how to create subsets based on the criterion of high vs. In fact, we are studying “good readers” and just want to focus on the students who had a reading score of 60 and higher. Suppose we wish to analyze just a subset of the hs1 data file. Run 2.2 Selecting cases using if or where statement Run proc print data="c:\sas_data\hs1" (obs=10) Using the file path or the SAS library will produce the same results. ![]() The two proc print commands below demonstrate two equivalent ways to reference the data file of interest hs1. We will once again begin by setting our library in SAS. 1.0 SAS statements and procs in this unit libnameĢ.0 Demonstration and explanation 2.1 Creating a library ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |