7 - Exploring Data - 2
7 - Exploring Data - 2
(Do not worry to see a lot of information. You do not need all information for examination. If you
go through 1/2 times this file, you will be understood/memorized all codes)
Exploring Data
First, you can try to solve the following programs by clicking the
menus in the SPSS windows and then try to do same works by using
the Syntax
In this unit we will explore our data set. By "explore", we mean conduct some descriptive statistics on variables that will be
important to the analysis that we plan to run. This exploration is very important, because it allows us to become familiar with our
data. Also, if there are any problems with the data, such as out-of-range values, etc., we can discover them.
We will begin by getting the descriptive statistics for some of the variables.
We can organize the output by the levels of a categorical variable by sorting on that variable and then splitting the file.
Now we will do the same thing, but we will only look at that the records for students who earned reading scores of 60 or above.
For the next example, we will select a different set of cases to be analyzed. We will begin by using all of the cases and then provide
the selection criteria.
Instead of selecting cases based on the value of a variable, we will now look at cases that fall into a range. As before, we will start by
resetting the selection criteria to include all cases. Next, we will specify the range of cases that we want included in the analysis.
Data * after removing the previous filter,
Select Cases... * select the first 40 cases.
filter off.
select "all cases"
use 1 thru 40.
Data execute.
Select Cases...
select "based on time or case range"
range 1 to 40 descriptives
Analyze variables=gender read write math
Descriptive Statistics science.
Descriptives...
select gender read write math science
Now we are going to move on to some different types of analyses. We will begin by using all of the cases in the data set. Then we
will compare the means of the variables read, write, math and science broken down by prgtype.
We can do some basic graphics, such as stem and leaf plots, boxplots and histograms.
Analyze * crosstabs.
Descriptive Statistics crosstabs
/tables = prgtype by ses.
Crosstabs...
select prgtype for the rows and ses for the columns * correlations.
OK correlations
Analyze /variables=read write math science.
Correlate
Bivariate... * changing from casewise to listwise
select read write math science deletion of missing data.
Analyze correlations
Correlate /variables=read write math science
/missing=listwise.
Bivariate...
select read write math science
click on "Options..."
click to "Exclude cases listwise"
Let's do some more graphics. The graphical representation of a correlation is a scatterplot, so let's try a couple of those.
Graphs * scatterplot.
Legacy Dialogs graph
/scatterplot = read with write.
Scatter/Dot...
Simple Scatter * scatterplot matrix.
click on "Define" graph
select write for the y-axis and read for the x-axis /scatterplot(matrix) = read write
Graphs math science.
Legacy Dialogs
Scatter/Dot...
Matrix Scatter
Define
select read math science write as matrix variables
* after removing the previous filter (with the "use all" command), create .
* a new filter and recompute the descriptive statistics.
use all.
compute f_acad=(prgtype="academic").
filter by f_acad.
execute.
descriptives
variables=gender read write math science.
descriptives
variables=gender read write math science.
* boxplot.
examine variables = write by gender
/plot = boxplot
/statistics = none.
* histogram.
graph
/histogram(normal) = write.
* histogram.
frequencies variables = ses
/histogram.
* crosstabs.
crosstabs
/tables = prgtype by ses.
* correlations.
correlations
/variables=read write math science.
* scatterplot.
graph
/scatterplot = read with write.
* SPSS does not provide code for including sun flowers on the graph.
* scatterplot matrix.
graph
/scatterplot(matrix) = read write math science.