UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Statistica Class Notes
Modifying Data

1.0 Demonstration and explanation

Let's begin by opening the data file.

Reordering variables in the data file is helpful both for organizational reasons as well as to minimize the amount of scrolling you need to do in order to see the variables that you are working with. 

Adding variable labels is a very useful data management strategy, and we strongly encourage you to take the time to do this when you input a data set or receive a data file.

Now let's add some value labels.

If we look back at the variable specifications, we can see that the variable prgtype is a string variable, and this may cause some difficulty when we are using this variable in analyses.  So let's create a numeric of this variable.

Add a variable label to the variable that we just created.

Renaming variables is easy.

Add a variable label and value labels to female.

Suppose that we would like to recode some values of a variable.  For example, we might want to change the 5s to missing for the variable race.  First, we will make a copy of the variable and then change the values in the copied variable.

There are many ways that you can create a new variable.  One way is to use a numeric expression.  For example, let's create a variable called total that will be the sum of the reading, writing and math scores.

Now let's summarize the variable that we have just created.

We will recode total to become grade as shown below.

Finally, let's make z-scores of some of our variables. 


How to cite this page

Report an error on this page

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


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California