Topic 3-SPSS and STATA
Topic 3-SPSS and STATA
TO
STATISTICAL PACKAGES
WISDOM MGOMEZULU
Spss
Open SPSS
File > Open > Click on data and click on
the file
OPENING OTHER FILES
Because Crosstabs creates a row
for each value in one variable and a column
for each value in the other, the procedure
is not suitable for continuous variables that
assume many values.
Crosstabs is designed for discrete variables- -
usually those measured on nominal or ordinal
scales.
STATA
Exploring data
Describe command
Shows you basic information about a stata data file ( for
instance number of observations, number of variables,
names of variables, etc.
.describe
Codebook command
It gives you all the codes/ variable values contained in
the dataset. You can produce a codebook for one
variable or all variables
.codebook
Cont……..
Inspect command
Similar to codebook, inspect command provide
you with a quick summary of a numeric variable
that differs from the summary provided by
summarize or tabulate.
.inspect
It reports number of negatives, zeros, and
positive values. It also produces a small
histogram
Cont….
list command
The command is useful for viewing all or range of
observations
.list make price mpg rep78 foreign in 1/10
tabulate command
This command is useful for obtaining frequency
tables
.tabulate
Cont….
tab1
Is used as a shortcut to request tables for a series
of variables (instead of typing the tabulate
command over and over)
tab1 rep78 foreign
We can also use plot to make a plot to visualize the
tabulated values
tabulate rep78, plot
Cont….
We can also produce crosstabs using the tabulate
command
tabulate rep78 foreign
You can also tell STATA to give you the frequencies and
percentages
tabulate rep78 foreign, column
Or you can tell STATA to give you only the percentages
tabulate rep78 foreign, column nofreq
Generating summary statistics
generate id = _n
Combining data : APPEND &
MERGE
You have two datasets that you wish to combine. Below,
we will draw a dataset as a box where, in the box, the
variables go across and the observations go down.
Append if you want to combine datasets vertically:
Cont…