|
|
|
||||
|
Help the Stat Consulting Group by
giving a gift
| |||||
|
Loading
|
|||||
Let's pretend that we are working on our honors thesis and that we want to study just "good readers", those with reading scores 60 or higher. We will open the file and then take a subset to include the students with reading scores of 60 or higher.
File Open select File: c:\statistica\hs1.sta Open
Data
Subset/Random Sampling...
Variables
click on "Select all"
OK
click on "Use selection condition expression"
Cases
click on "Specific, selected by" in the "include cases" box
in the "Specific, selected by" box, type read >= 60
OK
OK
Notice that a new data set has been created with only the desired cases. Now we will save our data.
File Save as c:\statistica\honors\hsgoodread.sta Save
We want to keep just some variables, including id female read and write.
Vars Delete... select the variables that you want to deleted OK
Let's suppose we are working on our masters thesis. The data are located in a folder called c:\statistica\masters and there are two files in this folder, one for the males (hsmale.sta) and one for the females (hsfemale.sta). We would like to combine these files.
File Open choose c:\statistica\masters\hsmale.sta Open
Statistics
Basis Statistics/Tables
Frequency tables
OK
Variables
select female
OK
Summary
single-click on the hsmale.sta data window to activate it.
Data
Merge
Cases
choose c:\statistica\masters\hsfemale.sta
Open
File Save As c:\statistica\masters\hsmasters.sta Save
Now let's suppose that we are working on our dissertation. The data are in a folder called c:\statistica\diss and there are two files in this folder, one with the demographic information (hsdem.sta) and one with the test scores (hstest.sta). We would like to match merge these files based on id. Before we can match merge these files, we need to open each file, sort it on id, and then save the sorted file.
File Open c:\statistica\diss\hsdem.sta Open
Data Sort... under "Key 1" select var and id OK
File Save As c:\statistica\diss\hsdem.sta Save
Now that we have sorted and saved the first file (hsdem.sta), we will do the same thing
for the second file (hstest.sta).
File Open c:\statistica\diss\hstest.sta Open
Data Sort... under "Key 1" select var and id OK
File Save As c:\statistica\diss\hstest.sta Save
Finally, we will open the first file (hsdem.sta) and merge it with the second file (hstest.sta). We will save the merged data file with the name hsdiss.sta.
File Open c:\statistica\diss\hsdem.sta Open
Data
Merge
Variables
choose c:\statistica\diss\hstest.sta
Open
under "Mode", click on "relational"
under "Relational merging options" type in the variable number
of id in both files
OK
File Save As c:\statistica\diss\hsdiss.sta Save
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services