101 Reasons for using the P-STAT SURVEY command
The Variables
-
Character variables.
Are
ordered alphabetically. Can be used
as row (stub) or column (banner) variables.
- Numeric categorical variables. The values dictate the order.
Can be used as either row or column variables.
- Numeric
quantity variables The values are totaled and averaged and
appear as one or two columns in the table.
- BY variables, if provided, cause each table to be produced for
every combination of the values of the BY variables.
- A group
of variables can be treated as a single
multiple response
variable.
- Multiple response variables can be either dummy (0/1) or multi-value
variables.
- Multiple response variables can define either the columns (banners)
or row (stubs) of a table.
The Labels
-
Extended labels
for column variables up to 78 characters
- Extended labels for the row variables: an indefinite number of
78 character labels to contain the
entire question
or item
-
Column (banner) labels
up to 64 characters
- Optional break points for column labels may be supplied.
- Row (stub) labels up to 80 characters
- Labels can
replace programmed text
such
as "Mean" or "Total Sample".
This provides complete language independence.
-
Titles:
9 top and 3 bottom titles can be provided.
- Additional unlimited number of lines for a
table title.
These are also used in the optional:
- Table of contents.
Table Layout
- The number of rows and columns in a single table is limited only
by a maximum of 250,000 cells per table.
- A maximum of 91 columns can be printed on a single page.
If there are additional
columns they are printed on subsequent pages.
- The columns of a table are defined by one
or more variables which may be
nested.
- The columns may represent the values of the
column (banner) variables,
their percents, sums, means or medians.
- The rows of a table are defined by a variable or a multiple response group
of variables which may be nested.
- Rows and columns may be
ordered
from low to high or high to low.
- Rows and columns may be
ranked
by either ascending or
descending frequency.
- Ranking may be applied to just some of the values. Controls are
for the first N values, or all but the
last N
values.
- Ranking, usually based on the row totals, may instead be
based on any column in the table.
- The labels
file may be used to specify which values to rank.
- The labels file may be used to control the exact order of rows or
columns.
- Many similar tables can be defined with a
single statement
and
processed in the same pass through the data file.
- The pieces of the table can be
rearranged:
For example, the column
totals can be at the top, the bottom or even in the middle.
- Selected pieces of the table can be ommitted. This permits tables,
for example, that
have only subtotals, only summary statistics, or have the
row totals
omitted.
The Table Body
- The table body many contain
just the
frequencies,
- - and/or column percents
- -
and/or
row percents
- - and/or percents of total counts
- - each of which can be based on the total count,
- -
and/or the
good n
(non-missing count),
- - or, for multiple response tables, the responses.
- Cell
expected values
and
cell chi-square
may be requested.
- An index value, a measure of how a column compares with the row total
may be requested.
-
When
an extra variable is cited, the body may also contain its
means,
- - and/or its sums,
-
- and/or its
medians.
- A choice of formula for computing the medians is available.
Formatting Options
- The
cell width
can be specified.
- The page output width can be specified.
- The number of lines per page can be specified.
- The width of the
margin
available for row labels can be specified.
- Spacing between the variables in the body can be controlled.
- Tabbed output can be requested.
-
Commas
may be properly placed in large numbers.
-
Empty cells
may be left blank or filled with the character of your choice.
- Handling of continuation pages includes: continuous printing,
- - page break when line count exceeded.
- - optional repetition of titles, labels, totals and/or question.
-
Stub (row) variables can be
grouped
together on a single page.
-
Tables can be
transposed.
- The row totals can be placed on the left or on the right.
Subtotals and Nets
-
Subtotals
can be defined to add the rows in a table. In a
multiple response situation these would be a total of the responses.
- Nets can be defined in multiple response tables to total the
respondents rather than the responses.
-
Subtotals and nets can be grouped together or
interleaved
in
the body of the table.
- Subtotals and nets usually have the same contents as the cells of
the body, but different contents can be requested.
- Rows may be ranked within each subtotal/net.
- The order of the subtotals/nets can be:
- the natural order as determined by the values,
- -
the order in which the subtotals/nets are
defined,
- -
determined by the
frequencies
of the subtotals/nets themselves.
- Rows with small frequencies can be
dynamically combined
into an "others" category.
Summary Statistics
The following statistics can be included in the summary section.
A table can be composed of just the
summary statistics.
- Total Counts, including missing
- Counts on non-missing values
- Mean of row (stub) variable or some other variable
- Sums of the means variable
- Standard deviation of the means variable
- Standard error of the means variable
- Variance of the means variable
- Median of the means variable
- Quartiles of the means variable
- Low row value
- High row value
- Range of row values
- Mode of row variable
- High row value
Other Statistics
-
Chi-square
with Degrees of Freedom and probability for each
2-way table
- Cramer's V for each 2-way table
-
F-test
(or t)
and probability each banner variable
- Signfificance level for chi-square and F-tests may be specified.
- Output for chi-square and F-test may be
limited to the
probability.
- Tests of independence between the cells
-
Signficance tests
of cell differences based on a t-test can be requested for specific
variables.
- Tests of independence or signficance can be computed between each
cell and its row totals.
-
t-tests between the means
of each pair of columns in the
summary section can be requested.
- All these tests can be done at a specified significance level.
PostScript and Tabbed Output Formats
-
Choice of fonts
and point sizes for titles, labels,
question and the body of the table.
- Border around each table.
- Optional boxed cells
- Control of underlining
- Multiple tables per page
- Ability to combine tables with text and plots.
The SURVEY command
- Variables may be selected, recoded and generated as the
file is input to the SURVEY command.
- Multiple input files can be dynamically joined.
- Multiple labels files can be supplied.
- An optional output file contains the tables in P-STAT system
file format.
- Include files are supported at both command and subcommand levels.
Return to Market Research Aids
nbsp;
Return to P-STAT's Home Page
THE EXAMPLES
Reason 1:
Stub and banner variables are usually numeric with value
labels used for identification. They can also be
character values, as Region and Gender are here.
The actual values are used
to label the rows and columns.
The Command
SURVEY region;
banner region,
stub gender;
The Table
====== Region ======
Total
Sample East North South
Total 4 1 1 2
Sample 100.0% 100.0% 100.0% 100.0%
Gender
f 2 1 - 1
50.0% 100.0% 50.0%
m 2 - 1 1
50.0% 100.0% 50.0%
missing - - - -
Base 4 1 1 2
100.0% 100.0% 100.0% 100.0%
Mean 1.50 1.00 2.00 1.50
S.D. 0.58 0.00 0.00 0.71
Return
Return to P-STAT's Home Page
Reason 3:
The Q in ( Q M ) causes banner variable income to be
treated as a "quantity" variable. A quantity variable has
totals in each cell rather than frequencies. The M requests
means as well.
The Command:
SURVEY paceset,
labels 'paceset.lab';
BAN income ( Q M ) gender,
stub age,
layout
labels
totals
question
body,
commas;
The Table:
======= Income ====== == Gender ===
Total
Sample Totals Mean Male Female
Total 80 2,476,660 34,398.06 39 40
Sample 100.0% 100.0% 100.0%
Age
Under 30 28 1,046,870 37,388.21 20 8
35.0% 51.3% 20.0%
30 to 50 27 703,460 29,310.83 11 16
33.8% 28.2% 40.0%
Over 50 23 676,020 35,580.00 7 15
28.7% 17.9% 37.5%
Return
P-STAT Home Page
Reason 5:
MR.STUB identifies a set of variables (VCR to Ans.Mach) that are
to be combined as a STUB variable. Here we have 4 yes/no variables
and a case can have several yeses, thus a multiple response.
The Command:
SURVEY paceset,
labels 'paceset.lab';
MR.STUB VCR to Ans.Mach,
ban age gender,
no missing,
no summary;
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total Sample 80 28 27 23 39 40
100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Which of the following do you own?
Video Cassette 45 19 13 12 27 18
Recorder 56.2% 67.9% 48.1% 52.2% 69.2% 45.0%
Compact Disc 28 10 13 5 12 16
Player 35.0% 35.7% 48.1% 21.7% 30.8% 40.0%
Portable 35 15 8 10 21 14
Telephone 43.8% 53.6% 29.6% 43.5% 53.8% 35.0%
Answering 37 18 12 7 20 16
Machine 46.2% 64.3% 44.4% 30.4% 51.3% 40.0%
Return
Return to P-STAT's Home Page
Reason 8:
Value labels and extended variable labels are stored in a
separate LABELS file. Here, a 1-78 character extended label
for the column variable is printed instead of the 1-16
character variable name.
The Command:
SURVEY election,
LABELS
'election.lab';
ban q1,
stub gender,
cell.width 9;
The Labels:
q1 'What do you think about the current Republican candidates?'
(1) do not like (2) no opinion (3) like /
Gender (1) male (2) female /
The Table:
==== What do you think ===
==== about the current ===
==== Republican ===
==== candidates? ===
Total do not no
Sample like opinion like
Total 4 1 2 1
Sample 100.0% 100.0% 100.0% 100.0%
Gender
male 2 1 1 -
50.0% 100.0% 50.0%
female 2 - 1 1
50.0% 50.0% 100.0%
Missing - - - -
Base 4 1 2 1
100.0% 100.0% 100.0% 100.0%
Mean 1.50 1.00 1.50 2.00
S.D. 0.58 0.00 0.71 0.00
Return
Return to P-STAT's Home Page
Reason 10:
Labels for the columns can span six lines. The total number
of characters that are displayed depends on the cell width.
This example shows both an extended label and long (up to
64 characters) value labels for the column variable.
The Command:
SURVEY election,
LABELS 'election.lab';
ban q1,
stub gender,
CELL.WIDTH 12;
The Labels:
q1 'What do you think about the current Republican candidates?'
(1) I disagree with their stands on most of the vital issues
(2) I have given the matter very little thought
(3) I agree with their positions on the vital issues /
Gender (1) male (2) female /
The Table:
=== What do you think about the ===
=== current Republican ===
=== candidates? ===
I disagree I agree
with their I have with their
stands on given the positions
most of the matter very on the
vital little vital
Total Sample issues thought issues
Total 4 1 2 1
Sample 100.0% 100.0% 100.0% 100.0%
Gender
male 2 1 1 -
50.0% 100.0% 50.0%
female 2 - 1 1
50.0% 50.0% 100.0%
Missing - - - -
Base 4 1 2 1
100.0% 100.0% 100.0% 100.0%
Mean 1.50 1.00 1.50 2.00
S.D. 0.58 0.00 0.71 0.00
Return
Return to P-STAT's Home Page
Reasons 9 and 13:
Variable Gender has 3 lines of extended labels text. When it is
used as the stub (row) variable all lines are printed.
The LABELS file has a special variable named SURVEY.LABELS
which contains alternate text for programmed text fields.
Text field 1 is normally "Total Sample". Here,
"Population is printed instead.
The Command:
SURVEY election,
LABELS 'election.lab';
ban q1,
stub gender,
cell.width 9;
The Labels:
q1 'What do you think about the current Republican candidates?'
(1) do not like (2) no opinion (3) like /
Gender
'Gender of the respondent'
'if Gender could not be determined in a telephone interview'
'the case was not processed'
(1) male (2) female /
SURVEY.LABELS (1) Population (2) Good Count (12) Average
(13) Standard deviation (101) ' ' (m1) No Response /
The Table:
==== What do you think ===
==== about the current ===
==== Republican ===
==== candidates? ===
do not no
like opinion like
Population 4 1 2 1
100.0% 100.0% 100.0% 100.0%
Gender of the respondent
if Gender could not be determined in a telephone interview
the case was not processed
male 2 1 1 -
50.0% 100.0% 50.0%
female 2 - 1 1
50.0% 50.0% 100.0%
No Response - - - -
Good Count 4 1 2 1
100.0% 100.0% 100.0% 100.0%
Average 1.50 1.00 1.50 2.00
Standard 0.58 0.00 0.71 0.00
deviation
Return
Return to P-STAT's Home Page
Reasons 14 and 15:
In this example the two titles are predefined in a
TITLES command.
The current date is substituted for .DATE., a
P-STAT system variable. LEFT, RIGHT and CENTER can
be specified.
Local definition of TITLES within SURVEY
is also supported.
Table titles may be supplied for each table where a
table is defined as a new stub variable or group of
stub variables.
The Command:s
TITLES
'.DATE.'
T2
'Pre-election Option Poll' $
SURVEY election,
labels 'election.lab',
TITLES;
TABLE.TITLES
'This Survey was conducted in February 1996'
'By Local Opinion Polls, Inc',
banner genger,
stub q1,
margin 20,
no missing,
no summary;
The Table:
Wed Mar 6 1996
Pre-election Option Poll
This Survey was conducted in February 1996
By Local Opinion Polls, Inc
== Gender ===
male female
Population 4 2 2
100.0% 100.0% 100.0%
What do you think about the current Republican candidates?
I disagree with 1 1 -
their stands on most 25.0% 50.0%
of the vital issues
I have given the 2 1 1
matter very little 50.0% 50.0% 50.0%
thought
I agree with their 1 - 1
positions on the 25.0% 50.0%
vital issues
Return
Return to P-STAT's Home Page
Reason 19:
The keyword WITHIN is used to indicate nesting.
Here we have a simple banner variable Own (with an
extended label) and then Gender within Own.
The Command:
SURVEY paceset,
labels 'paceset.lab';
ban own Gender WITHIN Own,
stub income.groups;
The Table:
Respondent
ownership no yes
Total
Sample no yes Male Female Male Female
Total Sample 80 11 69 5 6 34 34
100.0% 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Income of respondent
Under $20,000 2 1 1 - 1 - 1
2.5% 9.1% 1.4% 16.7% 2.9%
$20,000 to $40,000 50 9 41 4 5 17 23
62.5% 81.8% 59.4% 80.0% 83.3% 50.0% 67.6%
Over $40,000 20 - 20 - - 10 10
25.0% 29.0% 29.4% 29.4%
Missing 8 1 7 1 - 7 -
10.0% 9.1% 10.1% 20.0% 20.6%
Base 72 10 62 4 6 27 34
90.0% 90.9% 89.9% 80.0% 100.0% 79.4% 100.0%
Mean 2.25 1.90 2.31 2.00 1.83 2.37 2.26
S.D. 0.50 0.32 0.50 0.00 0.41 0.49 0.51
Return
Return to P-STAT's Home Page
Reason 20:
Additional columns for each banner variable are
requested by key letters in parentheses after the variable name.
The Mean, MEDian, Totals and PerCenTs can be requested. The
use of "NO V" in the list could be used to remove the individual values.
The Command:
SURVEY paceset,
labels 'paceset.lab';
BANNER Num.Tv ( M MED ),
stub age;
The Table:
====== Number of television sets in your home: =====
Total 5 or
Sample 1 2 3 4 more Mean Median
Total 80 6 22 18 27 7 3.09 3.00
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Age
Under 30 28 4 14 8 1 1 2.32 2.00
35.0% 66.7% 63.6% 44.4% 3.7% 14.3%
30 to 50 27 1 7 5 13 1 3.22 4.00
33.8% 16.7% 31.8% 27.8% 48.1% 14.3%
Over 50 23 1 1 4 12 5 3.83 4.00
28.7% 16.7% 4.5% 22.2% 44.4% 71.4%
Missing 2 - - 1 1 - - -
2.5% 5.6% 3.7%
Base 78 6 22 17 26 7 3.08 3.00
97.5% 100.0% 100.0% 94.4% 96.3% 100.0%
Mean 1.94 1.50 1.41 1.76 2.42 2.57
S.D. 0.81 0.84 0.59 0.83 0.58 0.79
Return
Return to P-STAT's Home Page
Reason 22:
Rows and columns are usually displayed in ascending numeric order.
This can by changed by using the ORDER subcommand.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub num.tv,
banner age Gender,
no missing,
no summary,
ORDER ROWS DOWN;
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total 80 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Number of television sets in your home:
5 or more 7 1 1 5 2 5
8.8% 3.6% 3.7% 21.7% 5.1% 12.5%
4 27 1 13 12 4 22
33.8% 3.6% 48.1% 52.2% 10.3% 55.0%
3 18 8 5 4 11 7
22.5% 28.6% 18.5% 17.4% 28.2% 17.5%
2 22 14 7 1 18 4
27.5% 50.0% 25.9% 4.3% 46.2% 10.0%
1 6 4 1 1 4 2
7.5% 14.3% 3.7% 4.3% 10.3% 5.0%
Return
Return to P-STAT's Home Page
Reason 23:
Rows and columns may be ranked by frequency.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub num.tv,
banner age gender,
no missing,
no summary,
RANK ROWS DOWN;
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total 80 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Number of television sets in your home:
4 27 1 13 12 4 22
33.8% 3.6% 48.1% 52.2% 10.3% 55.0%
2 22 14 7 1 18 4
27.5% 50.0% 25.9% 4.3% 46.2% 10.0%
3 18 8 5 4 11 7
22.5% 28.6% 18.5% 17.4% 28.2% 17.5%
5 or more 7 1 1 5 2 5
8.8% 3.6% 3.7% 21.7% 5.1% 12.5%
1 6 4 1 1 4 2
7.5% 14.3% 3.7% 4.3% 10.3% 5.0%
Return
Return to P-STAT's Home Page
Reason 24:
Ranking can be controlled so only some of the values are
ranked. If the number is positive, only the first N values are
ranked. If the number is negative, all but the last N values are
ranked.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub num.tv,
banner age gender,
RANK ROWS -2 DOWN,
no missing,
no summary;
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total 80 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Number of television sets in your home:
2 22 14 7 1 18 4
27.5% 50.0% 25.9% 4.3% 46.2% 10.0%
3 18 8 5 4 11 7
22.5% 28.6% 18.5% 17.4% 28.2% 17.5%
1 6 4 1 1 4 2
7.5% 14.3% 3.7% 4.3% 10.3% 5.0%
4 27 1 13 12 4 22
33.8% 3.6% 48.1% 52.2% 10.3% 55.0%
5 or more 7 1 1 5 2 5
8.8% 3.6% 3.7% 21.7% 5.1% 12.5%
Return
Return to P-STAT's Home Page
Reason 28:
Multiple STUB, GR.STUB and MR.STUB subcommands, with optional
table titles, can be processed in a single pass of the file when
the banner variables and the table options remain the smae.
The Command:
SURVEY s0296,
labels 's0296.lab';
layout
question
labels
totals.area
body
summary,
banner Age Gender Occupation Education,
STUB
Q1A to Q39,
MR.STUB
Q40A to Q40G,
STUB
Q43, Q45, Q90 TO 103
TABLE.TITLES
'These two tables are to be grouped together',
GR.STUB
Q42 Q44 ;
TABLE.TITLES
'These tables have means on variable income'
STUB Item33
TABLES.TITLES 'Item 33 will be processed in the same pass as'
STUB Item35
TABLE.TITLES 'Item 35 and Q244 though each as a different table title'
Q244,
MEANS Income;
Return
Return to P-STAT's Home Page
Reason 29:
The LAYOUT subcommand can be used to rearrange pieces of a table.
Any piece that is not mentioned is omitted.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub own,
banner age gender,
LAYOUT QUESTION LABELS BODY TOTALS;
The Table:
Respondent ownership of electronic items
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
no 11 2 6 3 5 6
13.8% 7.1% 22.2% 13.0% 12.8% 15.0%
yes 69 26 21 20 34 34
86.2% 92.9% 77.8% 87.0% 87.2% 85.0%
Total 80 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Return
Return to P-STAT's Home Page
Reason 30:
The row totals which are usually printed as the first
column of a table can be omitted or moved to the right.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub own,
banner age gender,
layout
question
labels
body
totals,
NO ROW.TOTALS;
The Table:
Respondent ownership of electronic items
======== Age ======= == Gender ===
Under 30 to Over
30 50 50 Male Female
no 2 6 3 5 6
7.1% 22.2% 13.0% 12.8% 15.0%
yes 26 21 20 34 34
92.9% 77.8% 87.0% 87.2% 85.0%
Total 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0%
Return
Return to P-STAT's Home Page
Reason 31:
The body of the table usually contains both the counts
(frequencies) and the column percents. However the contents
can be controlled with the BODY CONTAINS subcommand.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub own,
banner age gender,
layout
question
labels
body,
BODY
CONTAINS
COUNTS;
The Table:
Respondent ownership of electronic items
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
no 11 2 6 3 5 6
yes 69 26 21 20 34 34
Return
Return to P-STAT's Home Page
Reason 33:
A combination of the BODY subcommand and the PERCENTS
subcommand is used to get a table in which the cells
contains just the row and column percents. Note: The
percents are printed in the order specified.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub own,
banner age gender,
layout
question
labels
body,
ROW
COLUMN
PERCENTS,
BODY
CONTAINS
PERCENTS;
The Table:
Respondent ownership of electronic items
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
no 100.0% 18.2% 54.5% 27.3% 45.5% 54.5%
13.8% 7.1% 22.2% 13.0% 12.8% 15.0%
yes 100.0% 37.7% 30.4% 29.0% 49.3% 49.3%
86.2% 92.9% 77.8% 87.0% 87.2% 85.0%
Return
Return to P-STAT's Home Page
Reason 36:
Percents are usually based on the total n (count).
The base can be changed to the good n (missing is
excluded) or, in a multiple response situation to
the responses. This example has row percents based
on both the total n and the good n.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub income.groups,
banner age ( T ) gender ( T ),
layout
labels
question
body,
margin 10,
ROW PERCENTS
BASED
GOOD.N,
ROW PERCENTS
BASED
TOTAL.N;
The Table:
=========== Age =========== ====== Gender ======
Total Under 30 to Over
Sample 30 50 50 Good N Male Female Good N
Income of respondent
Under 2 - 2 - 2 - 2 2
$20,000 100.0% 100.0% 100.0%
100.0% 100.0% 100.0%
$20,000 to 50 18 19 13 50 21 28 49
$40,000 100.0% 36.0% 38.0% 26.0% 42.9% 57.1%
100.0% 36.0% 38.0% 26.0% 42.0% 56.0%
Over 20 10 3 6 19 10 10 20
$40,000 100.0% 52.6% 15.8% 31.6% 50.0% 50.0%
100.0% 50.0% 15.0% 30.0% 50.0% 50.0%
Return
Return to P-STAT's Home Page
Reason 38:
The contribution of each cell to a possible chi square
statistic is requested with the CELL.CHI subcommand. The
number of cases that are expected in the cell given the
marginals is requested with the EXPECTED.VALUES subcommand.
The Command:
SURVEY paceset,
labels 'paceset.lab';
stub income.groups,
banner age gender,
layout
labels
totals
question
body,
margin 10,
no percents,
CELL.CHI,
EXPECTED.VALUE;
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total
Sample 80 28 27 23 39 40
Income of respondent
Under 2 - 2 - - 2
$20,000 0.8 0.7 0.5 0.9 1.1
0.8 2.6 0.5 0.9 0.7
$20,000 to 50 18 19 13 21 28
$40,000 19.7 16.9 13.4 21.4 27.6
0.1 0.3 0.0 0.0 0.0
Over 20 10 3 6 10 10
$40,000 7.5 6.4 5.1 8.7 11.3
0.8 1.8 0.2 0.2 0.1
Return
Return to P-STAT's Home Page
Reason 40:
Means on another variable can be requested for the body
of the table as well as the summary.
The Command:
SURVEY paceset,
labels 'paceset.lab';
banner age gender,
stub income.groups,
MEANS Income,
BODY
CONTAINS
COUNTS
MEANS,
SUMMARY
CONTAINS
BASE
MEANS,
no missing,
COMMAS,
places means 0;
The Table:
========= Age ========= === Gender ====
Total Under 30 to
Sample 30 50 Over 50 Male Female
Total Sample 72 28 24 19 31 40
100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Income of respondent
Under $20,000 2 - 2 - - 2
18,400 18,400 18,400
$20,000 to $40,000 50 18 19 13 21 28
30,007 31,359 28,224 30,740 31,291 28,980
Over $40,000 20 10 3 6 10 10
46,976 48,240 43,467 46,067 48,240 45,711
Base 72 28 24 19 31 40
100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Mean Income 34,398 37,388 29,311 35,580 36,759 32,634
Return
Return to P-STAT's Home Page
Reason 42:
Medians on an external variable ban be computed for the body as
well as the summary section. Means and medians in the same table
must be on the same variable.
The Command:
SURVEY paceset,
labels 'paceset.lab';
no missing,
commas,
places means 0,
places medians 0,
table.title 'Cells contain counts' 'means of income' 'medians of Income',
banner age gender,
stub income.groups,
MEANS Income,
BODY
CONTAINS
COUNTS
MEANS
MEDIANS,
SUMMARY
CONTAINS
MEANS
MEDIANS;
The Table:
Cells contain counts
means of income
medians of Income
========= Age ========= === Gender ====
Total Under 30 to
Sample 30 50 Over 50 Male Female
Total Sample 72 28 24 19 31 40
100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Income of respondent
Under $20,000 2 - 2 - - 2
18,400 18,400 18,400
18,400 18,400 18,400
$20,000 to $40,000 50 18 19 13 21 28
30,007 31,359 28,224 30,740 31,291 28,980
30,085 31,350 25,900 31,800 32,500 27,650
Over $40,000 20 10 3 6 10 10
46,976 48,240 43,467 46,067 48,240 45,711
45,850 46,950 42,500 46,050 46,950 45,400
Mean Income 34,398 37,388 29,311 35,580 36,759 32,634
Median 32,510 34,550 25,950 32,520 34,700 30,900
Return
Return to P-STAT's Home Page
Reason 51:
Cells with no contents are normally represented with a dash on
the first row in the cell. This can be changed to any character
of your choice with the CHARACTER subcommand. When two characters
are supplied, all rows in the cell are filled.
The Command:
SURVEY paceset,
labels 'paceset.lab';
banner age gender,
stub income.groups,
CHARACTER ZERO
'0' '0';
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total Sample 80 28 27 23 39 40
100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Income of respondent
Under $20,000 2 0 2 0 0 2
2.5% 0.0% 7.4% 0.0% 0.0% 5.0%
$20,000 to $40,000 50 18 19 13 21 28
62.5% 64.3% 70.4% 56.5% 53.8% 70.0%
Over $40,000 20 10 3 6 10 10
25.0% 35.7% 11.1% 26.1% 25.6% 25.0%
Missing 8 0 3 4 8 0
10.0% 0.0% 11.1% 17.4% 20.5% 0.0%
Base 72 28 24 19 31 40
90.0% 100.0% 88.9% 82.6% 79.5% 100.0%
Mean 2.25 2.36 2.04 2.32 2.32 2.20
S.D. 0.50 0.49 0.46 0.48 0.48 0.52
Return
Return to P-STAT's Home Page
Reason 55:
A group of variables can be printed on a single page and share
the labels and totals areas of the display. This is often used
for tables of summary statistics.
The Command:
SURVEY paceset,
labels 'paceset.lab';
banner num.tv,
GR.STUB
Age Gender Income.Groups,
layout
labels
question
summary,
no base,
margin 10;
The Table:
== Number of television sets in ==
== your home: ==
Total 5 or
Sample 1 2 3 4 more
Age
Mean 1.94 1.50 1.41 1.76 2.42 2.57
S.D. 0.81 0.84 0.59 0.83 0.58 0.79
Gender
Mean 1.51 1.33 1.18 1.39 1.85 1.71
S.D. 0.50 0.52 0.39 0.50 0.37 0.49
Income of respondent
Mean 2.25 2.17 2.29 2.17 2.23 2.43
S.D. 0.50 0.75 0.46 0.39 0.51 0.53
Return
Return to P-STAT's Home Page
Reason 56:
Tables can be transposed so that the banner variable defines
the rows and the stub variable defines the columns. The layout
now has the summary section as columns rather than rows.
This is often used with GR.STUBS (grouped variables) to produce
tables of marginals.
The Command:
SURVEY paceset;
gr.stub
age gender income.groups,
margin 10,
TRANSPOSE;
The Table:
Total Miss
Sample 1 2 3 ing Base Mean S.D.
Age 80 28 27 23 2 78 1.94 0.81
100.0% 35.0% 33.8% 28.7% 2.5% 97.5%
Gender 80 39 40 - 1 79 1.51 0.50
100.0% 48.8% 50.0% 1.2% 98.8%
Income. 80 2 50 20 8 72 2.25 0.50
Groups 100.0% 2.5% 62.5% 25.0% 10.0% 90.0%
Return
Return to P-STAT's Home Page
Reason 58:
Subtotals are automatically included in the table when
DEFINE statements provide the labels, variables and values to
be totaled.
The Command:
SURVEY paceset,
labels 'paceset.lab';
DEFINE 'Some Television Sets' NUM.TV 1 to 3,
DEFINE 'Many Television Sets' NUM.TV 4 to 6,
stub num.tv,
banner age gender,
no missing,
no summary;
The Table:
Total Under 30 to Over
Sample 30 50 50 Male Female
Total 80 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Number of television sets in your home:
1 6 4 1 1 4 2
7.5% 14.3% 3.7% 4.3% 10.3% 5.0%
2 22 14 7 1 18 4
27.5% 50.0% 25.9% 4.3% 46.2% 10.0%
3 18 8 5 4 11 7
22.5% 28.6% 18.5% 17.4% 28.2% 17.5%
4 27 1 13 12 4 22
33.8% 3.6% 48.1% 52.2% 10.3% 55.0%
5 or more 7 1 1 5 2 5
8.8% 3.6% 3.7% 21.7% 5.1% 12.5%
Some 46 26 13 6 33 13
Television 57.5% 92.9% 48.1% 26.1% 84.6% 32.5%
Sets
----------
Many 34 2 14 17 6 27
Television 42.5% 7.1% 51.9% 73.9% 15.4% 67.5%
Sets
----------
Return
Return to P-STAT's Home Page
Reason 60:
Subtotals and nets can be inserted into the body of the
table. They can either precede or follow the values
included in their definitions.
The Command:
SURVEY paceset,
labels 'paceset.lab';
define 'Some Television Sets' NUM.TV 1 to 3,
define 'Many Television Sets' NUM.TV 4 to 6,
stub num.tv,
banner age gender,
no missing,
no summary,
SUBTOTALS
BEFORE
LOW VALUES;
The Table:
======== Age ======= == Gender ===
Total Under 30 to Over
Sample 30 50 50 Male Female
Total 80 28 27 23 39 40
Sample 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%
Number of television sets in your home:
Some 46 26 13 6 33 13
Television 57.5% 92.9% 48.1% 26.1% 84.6% 32.5%
Sets
----------
1 6 4 1 1 4 2
7.5% 14.3% 3.7% 4.3% 10.3% 5.0%
2 22 14 7 1 18 4
27.5% 50.0% 25.9% 4.3% 46.2% 10.0%
3 18 8 5 4 11 7
22.5% 28.6% 18.5% 17.4% 28.2% 17.5%
Many 34 2 14 17 6 27
Television 42.5% 7.1% 51.9% 73.9% 15.4% 67.5%
Sets
----------
4 27 1 13 12 4 22
33.8% 3.6% 48.1% 52.2% 10.3% 55.0%
5 or more 7 1 1 5 2 5
8.8% 3.6% 3.7% 21.7% 5.1% 12.5%
Return
Return to P-STAT's Home Page
Reason 64:
When rank is used with subtotals, the order of the
subtotals can be specified.
The Command:
SURVEY pets,
labels `pets.lab';
define `birds' pet 1 6,
define `mammals' pet 2 3 5,
define `other animals' pet 4 7 8,
banner gender age,
stub pet,
no percents,
no missing,
no summary,
margin 16,
gap 2,
no skip,
indent 4,
subtotals
before
low value,
RANK
WITHIN
SUBTOTALS;
$
The Table:
== Gender === ======== Age =======
Total Under 20 to 40 and
Sample male female 20 39 over
Total Sample 925 478 447 261 319 345
What animal makes the best pet?
birds 155 100 55 28 48 79
-----
parakeet 80 25 55 16 25 39
canary 75 75 - 12 23 40
mammals 675 325 350 220 230 225
-------
cat 350 150 200 100 110 140
dog 275 150 125 100 100 75
horse 50 25 25 20 20 10
other animals 95 53 42 13 41 41
-------------
fish 90 49 41 9 40 41
turtle 4 3 1 3 1 -
snake 1 1 - 1 - -
Return
Return to P-STAT's Home Page
Reason 65:
When rank is used with subtotals, you can request that
the subtotals be ranked and the rows ranked within them.
The Command:
SURVEY pets,
labels `pets.lab';
define `birds' pet 1 6,
define `mammals' pet 2 3 5,
define `other animals' pet 4 7 8,
banner gender age,
stub pet,
no percents,
no missing,
no summary,
margin 16,
gap 2,
no skip,
indent 4,
subtotals
before
low value,
RANK CONTROLS SUBTOTALS;
$
The Table:
== Gender === ======== age =======
Total Under 20 to 40 and
Sample male female 20 39 over
Total Sample 925 478 447 261 319 345
What animal makes the best pet?
mammals 675 325 350 220 230 225
-------
cat 350 150 200 100 110 140
dog 275 150 125 100 100 75
horse 50 25 25 20 20 10
birds 155 100 55 28 48 79
-----
parakeet 80 25 55 16 25 39
canary 75 75 - 12 23 40
other animals 95 53 42 13 41 41
-------------
fish 90 49 41 9 40 41
turtle 4 3 1 3 1 -
snake 1 1 - 1 - -
Return
Return to P-STAT's Home Page
Reason 67:
The summary section usually includes the base (good n), means and
standard deviation. This can be expanded to include a number of
other univariate statistics.
The Command:
SURVEY paceset,
labels `paceset.lab' `survey.lab',
weight weight;
layout
labels
summary,
banner age own,
stub income.groups,
margin 20,
cell.width 8,
gap 2,
no percents,
SUMMARY
CONTAINS
TOTAL.N
UNWEIGHTED.N
BASE
UNWEIGHTED.BASE
SUM
MEAN
S.D.
VARIANCE
STANDARD.ERROR,
MODE QUARTILES
LOW
HIGH
RANGE;
File survey.lab contains:
Weight ( xl ` ' ) /
SURVEY.LABELS
(1) Population:Weighted (2) Good N:Weighted
(4) Unweighted total (5) Unweighted Good N
(11) Sums (12) Average
(13) Standard deviation (14) S.D. squared (16) Q2
(18) Low value (19) High value (20) High - Low
(21) Q1 (22) Q3 (101) Respon*dents
(202) ` ' (211) No Reply to the question /
The Table:
== Respondent =
========= Age ========= == ownership =
Respon Under 30 to
dents 30 50 Over 50 no yes
Population: 82 25 26 29 11 71
Weighted
Unweighted total 80 28 27 23 11 69
Good N:Weighted 73 25 23 24 10 63
Unweighted Good N 72 28 24 19 10 62
Sums 164 59 48 55 19 145
Average 2.25 2.36 2.04 2.32 1.91 2.31
Standard deviation 0.50 0.49 0.46 0.48 0.31 0.50
S.D. squared 0.25 0.24 0.21 0.23 0.10 0.25
Standard error 0.06 0.10 0.10 0.10 0.10 0.06
Mode 2 2 2 2 2 2
Q1 2.00 2.00 2.00 2.00 2.00 2.00
Q2 2.00 2.00 2.00 2.00 2.00 2.00
Q3 3.00 3.00 2.00 3.00 2.00 3.00
High value 1 2 1 2 1 1
Low value 3 3 3 3 2 3
High - Low 2 1 2 1 1 2
Return
Return to P-STAT's Home Page
Reason 81:
The chi-square can be requested for each 2-way table.
The Command:
SURVEY paceset,
LABELS `paceset.lab' ;
banner income.group,
&
stub age,
no missing,
&
skip 0,
CHI;
The Table:
$20,
Under 000 to
Total $20, $40, Over $
Sample 000 000 40,000
Total 80 2 50 20
Sample 100.0% 100.0% 100.0% 100.0%
Age
Under 30 28 - 18 10
35.0% 36.0% 50.0%
30 to 50 27 2 19 3
33.8% 100.0% 38.0% 15.0%
Over 50 23 - 13 6
28.7% 26.0% 30.0%
Base 78 2 50 19
97.5% 100.0% 100.0% 95.0%
Mean 1.94 2.00 1.90 1.79
S.D. 0.81 0.00 0.79 0.92
Chi Square 7.1653 *
DF for Chi 4.
Probability 0.1274
* Some cells had an expected value of less than 5.
Return
Return to P-STAT's Home Page
Reason 83:
F tests can be requested. If the column variable has only
2 values, the t value is also reported.
The Command:
SURVEY cell,
labels `cell.lab';
banner process treatment,
group.stubs Efficiency Rating,
places means 3,
cell.width 9,
margin 14,
layout
labels
question
summary,
summary
contains
means
s.d
s.e,
F.TEST;
The Table:
=== Bake ===
===== Processing Lab ===== === Treatment ===
Total
Sample TG SW BK Short Long
Efficiency
Mean 4.921 5.470 4.066 5.276 4.175 5.621
S.D. 1.103 0.490 1.413 0.496 1.151 0.326
Standard error 0.138 0.110 0.301 0.106 0.207 0.057
F value 14.7035 47.9747
Probability 0.0000 0.0000
t value 6.9264
Rating
Mean 18.764 13.959 27.103 14.794 24.024 13.823
S.D. 12.466 4.978 17.471 5.213 15.823 4.387
Standard error 1.558 1.113 3.725 1.112 2.842 0.764
F value 9.5711 12.6898
Probability 0.0002 0.0007
t value 3.5623
Return
Return to P-STAT's Home Page
Reason 87:
Significance tests are used to determine if there are differences
between cells that should be
investigated further.
The Command:
SURVEY t3,
labels `test.lab';
banner region,
stub gender,
no missing,
summary
contains
means,
TEST
PROPORTION
.90;
The Table:
====== Region ======
Total North South
Sample East East West
A B C
Total 990 191 357 442
Sample 100.0% 100.0% 100.0% 100.0%
Gender
female 182 51 65 66
18.4% 26.7% 18.2% 14.9%
BC
male 808 140 292 376
81.6% 73.3% 81.8% 85.1%
A A
Mean 1.82 1.73 1.82 1.85
.90 significance level used for t-test of proportions
Return
Return to P-STAT's Home Page
Reason 89:
t-tests between each pair of means for each of the
banner variables can be requested.
The Command:
SURVEY cell,
labels `cell.lab';
banner process treatment,
group.stubs efficiency rating,
places means 3,
cell.width 9,
margin 14,
layout
labels
question
summary,
summary
contains
means
s.d
s.e,
f.test,
TEST MEANS;
The Table:
=== Bake ===
===== Processing Lab ===== === Treatment ===
Total
Sample TG SW BK Short Long
A B C D E
Efficiency
S.D. 1.103 0.490 1.413 0.496 1.151 0.326
Standard error 0.138 0.110 0.301 0.106 0.207 0.057
Mean 4.921 5.470 4.066 5.276 4.175 5.621
B B D
F value 14.7035 47.9747
Probability 0.0000 0.0000
t value 6.9264
Rating
S.D. 12.466 4.978 17.471 5.213 15.823 4.387
Standard error 1.558 1.113 3.725 1.112 2.842 0.764
Mean 18.764 13.959 27.103 14.794 24.024 13.823
AC E
F value 9.5711 12.6898
Probability 0.0002 0.0007
t value 3.5623
.95 significance level used for t-test of means
Return
Return to P-STAT's Home Page
Reason 91:
PostScript output can be requested. Different fonts can be specified
for titles, labels, the question itself and the body of the table.
The orientation can be changed and multiple surveys can be placed
on a single page.
The Command:
SURVEY paceSet,
labels `paceset.lab',
pr `paceSet.ps',
titles,
POSTSCRIPT,
PORTRAIT,
FORMAT 2 ,
FONT 'ZapfChancery-MediumItalic' 10;
banner age gender,
stub income.groups,
mean income,
places means 0,
cell.width 9,
char for percent ' ' ;
The Table: