|
1. How can I change the appearance of the printouts?
2. How can I do an analysis on a subgroup of the data (e.g., just females)?
3. How can I do an analysis on more than one subgroup?
4. How can I create groups (categories) for interval data?
5. How do I keep track of all the options?
6. How do I deal with the open-ended questions?
7. How can I get the Input fields in the Data Manager to line up properly?
8. How can I get the Data Manager to accept data for a particular variable?
9. How can I do the same study again with a new set of data?
10. How can I create a new study that is similar (not identical) to a previous study?
11. Can I change the codebook and form after entering some data?
12. How can I import a fixed format sequential ASCII data file into StatPac?
13. How can I fix a "duplicate variable" error message?
14. How do I combine data files so they can be analyzed together?
15. How do I deal with an "other" category?
16. I have more general questions about StatPac for
Windows.
17. I have questions about Web surveys.
QUESTION 1
- My printouts are close to what I want, but not
exactly. What can I do to change the way StatPac works?
ANSWER
- Options are used to control the way that
StatPac formats reports. While using the analysis
procedure file editor, move the cursor to the procedure
you want to modify. Select Options to evoke the Options
window. Change the desired option(s) and click OK.
Top
QUESTION 2
- I want to perform an analysis using just the female
respondents. What line do I include in the procedure?
ANSWER
- To perform an analysis on a subset of data
(e.g., just the females), use the SELECT command in the
same procedure as the analysis command. For example, if Sex
had been coded as M=Male and F=Female, the command might
be:
IF
Sex="F" THEN SELECT
FREQ Some_Other_Variable
..
Quotation marks are used around the
"F" because Sex was coded as an alpha
variable. Numeric variables do not need quotation marks
around the selection criteria. For example, if Sex
had been coded as 1=Male and 2=Female, the command would
be:
IF SEX=2
THEN SELECT
FREQ Some_Other_Variable
..
Top
QUESTION 3
- I want to perform an analysis on respondents that make
at least $20,000 per year. What line do I include in the
procedure?
ANSWER
- This is essentially the same as the previous
problem. The difference being that we're selecting
multiple categories, instead of just one. Suppose the Income
variable is coded as:
1=Under 10,000
2=10,000 - 19,999
3=20,000 - 29,999
4=30,000 - 39,999
5=40,000 or more.
To select respondents making 20,000 or
more, we need to select response codes 3, 4 and 5. Any of the following lines could be used
to solve the problem:
IF
Income>2 THEN SELECT
IF Income>=3 THEN SELECT
IF Income>=3 AND Income<=5 THEN SELECT
IF Income=3 OR Income=4 OR Income=5 THEN SELECT
IF Income="3/4/5" THEN SELECT
When using the slash to indicate a series
of OR statements (last example), quotation marks are
required for both alpha and numeric-type variables.
Top
QUESTION 4
- I want to use an Age variable as one of the
points in a banner table, but age was entered as the
actual age instead of being coded into categories. How
can I make it work in a banner table?
ANSWER
- There are many different solutions to this
problem. In order to do this, you need to define age
groups. The first solution is to recode the Age
variable, and then assign value labels to the recoded
data. Two lines are required.
RECODE Age
(LO-20=1)(21-30=2)(31-40=3)(41-HI=4)
LABELS Age (1=Under 21)(2=21-30)(3=31-40)(4=Over 40)
The recoded and newly labeled Age
variable could then be used in a banners or crosstabs
table.
If you wanted access to both the raw data
and the recoded data, you could create a new variable and
have it contain the recoded age data. This technique has
the added advantage that the original data remains intact
even when the SAVE command is used. Here are three more
solutions to this problem:
LET
Age-Group=Age
RECODE Age-Group (LO-20=1)(21-30=2)(31-40=3)(41-HI=4)
LABELS Age-Group (1=Under 21)(2=21-30)(3=31-40)(4=Over
40)
..
COMPUTE (N2) Age-Group=Age
RECODE Age-Group (LO-20=1)(21-30=2)(31-40=3)(41-HI=4)
LABELS Age-Group (1=Under 21)(2=21-30)(3=31-40)(4=Over
40)
...
NEW (N1) "Age-Group" Age Group
IF Age<21 THEN COMPUTE Age-Group=1
IF Age>=21 AND Age<=30 THEN COMPUTE Age-Group=2
IF Age>=31 AND Age<=40 THEN COMPUTE
Age-Group="3"
IF Age>=41 THEN COMPUTE Age-Group=4
LABELS Age-Group (1=Under 21)(2=21-30)(3=31-40)(4=Over
40)
..
Top
QUESTION 5
- There seem to be so many options for some of the
analyses. How do I keep them all straight?
ANSWER
- This one's easy...you don't have to. There are
only a few options that have profound impact on the way
analyses are performed. The default values for the
options are sufficient for most applications. When in
doubt, first try running the procedure and make note of
what you would like to change. Then select Options to see
if the appropriate option is readily apparent. If not,
use the on-line help to review the analysis. After you've
found the option you are looking for, add it to the
procedure to confirm that it does what you want. Finally,
if this is something you want to change on all future
analyses, add an exclamation point suffix to the option
and rerun the procedure. This will make the current
option setting the default and you won't need to be
concerned with that option again. After running a few
procedures, you'll have configured the default formats
for StatPac to produce the reports you most often use.
Top
QUESTION 6
- How do I deal with the open-ended questions?
ANSWER
- You can do two things with open-ended data.
The first is to just list the actual comments. Use the
LIST keyword to show the actual verbatim text. If the
variable were called Comments, the command would
be:.
LIST
Comments
..
The output from the procedure would print
dashes for respondents who made no comment. The IF-THEN
command could be used to limit the output to only those
respondents who made a comment. These two procedures
would produce identical output. The first one selects
all records where the Comments variable is not
blank. The second one rejects all records that
are blank.
IF
Comments <> " " THEN SELECT
LIST Comments
..
IF
Comments = " " THEN REJECT
LIST Comments
..
Another solution is to code the responses
into categories. Run FREQUENCIES on the open-ended
comment and set the OE option equal to Y. This will evoke
StatPac's coding program (Verbatim Blaster). Your
procedure might look like this:
FR
Comments
OPTIONS OE=Y
StatPac's Verbatim Blaster module is easy
to use, but will be even easier if you first read about
it in the manual. You'll find complete information
on-line under FREQUENCIES with the OE option.
Top
QUESTION 7
- I'm using the Data Manager and the program is acting
goofy (things are not lining up properly). What did I do
wrong?
ANSWER
- The most likely problem is that the data entry form was
compiled on a different computer with a different screen
resolution. Close StatPac. Delete the
"codebookname.frc" file. Then run StatPac again
and the problem will correct itself.
Top
QUESTION 8
- I'm using the Data Manager and one of the data input
fields won't accept data even though the data is correct.
How do I fix the problem?
ANSWER
- The codebook is somehow limiting the data
input for that variable. Examine the variable with the
Variable Detail window or the Grid. Check the valid
codes. A common problem is where the valid codes are
lower case, but the data entry control parameters have
Caps Lock set. No matter what the data entry person
types, it is converted to upper case, and the only valid
codes are defined as lower case. To fix the problem,
either change the valid codes to upper case, or set Caps
Lock off. Another common problem is having defined a
field as numeric, when the data actually contains numbers
and letters. For example, many internal ID codes use
numbers and letters. The solution is to change the format
for the variable from "N" to "A".
Another common problem is to have defined some of the
valid codes (but not all of them).
Top
QUESTION 9
- I have finished analyzing a study and I want to do the
same study again with a new set of data. How can I do
this without retyping the study design?
ANSWER
- If the new study uses exactly the same
variables, then the easiest way to do this is to rename
the existing data file to something else. For example, if
you conducted a survey called "Opinions" in
2002 and you wanted to do the same survey in 2003, you
might rename the 2002 data from "Opinions.dat"
to "Opinions-2002.dat" and then begin entering
the new data. To rename the old data file, select File,
Open, Data File, and right click on the file to be
renamed.
If for some reason you wanted to analyze
the old data file, use the DATA command to specify the
old data file (with a different name than the codebook).
STUDY
Opinions
DATA Opinions-2002
Top
QUESTION 10
- I need to do a new study similar to a previous study,
but some of the questions are different. Do I have to
retype all the study information?
ANSWER
- No. There are two ways to do this. The first
way is to first create a duplicate copy of the previous
codebook using a new name. Load the codebook and then
select File, Save Codebook, and give it a new name. You
can then modify the new codebook file. The other way to do
this is in the Grid. Load the previous codebook as a
library (select File, Open Library) and you will be able
to extract selected variables from the previous codebook
into the Grid.
Top
QUESTION 11
- I designed a codebook and form and tried entering a few
data records and discovered that I need to change
something in the study design. How can I do this after
the data file already has data?
ANSWER
- Once data has been entered into a data file,
you can still change any text in the codebook or data
manager form. You can also change the field width of any
variable. If you change the field width of a variable,
the associated data file will also be adjusted when you
save the codebook..
However, once a data file exists, you
should not 1) add a new variable, 2) delete a variable,
or 3) change the order of variables, because the data
file would no longer match the revised codebook. When you
load a codebook that has an associated data file, StatPac
will give you a warning that lets you turn off the
buttons for these operations. (You can turn off the
warning by selecting Format, Codebook Safety, No).
If you don't need the data file (e.g.,
it's just dummy test data), simply delete the data file
and then make the desired changes to the codebook You
will also have to modify the data entry form because it
does not automatically reflect the changes in the
codebook. The easiest way to change the form is to simply
delete the existing form and recreate it after the
codebook has been modified. To delete the form, select
Edit, Select All, and then click the Cut button or select
Edit, Cut. Make the changes to the codebook with the
Variable Detail window or the Grid and then recreate the
form.
If you have already entered a substantial
number of real data records, and then discover you need
to add a new variable, you must run an analysis to create
the new variable in both the study design and data file.
The form however, will not automatically be updated to
reflect the new variable. Therefore, you must either
delete the form (see above) and recreate it, or you can
manually insert the new variable in the proper place of
the form. A new variable can be created by running a
three-line procedure:
STUDY
CodebookName
NEW (Format) "New_Variable_Name" New Variable
Label
SAVE
..
For example, in a study called
"Research", you could create a new numeric
two-column variable called Number, with the
following commands:
STUDY
Research
NEW (N2) "Number" Special New Variable
SAVE
..
When you run the procedure, both the
codebook and data will be updated to include the new Number
variable. The new Number variable would be added
to the end of the existing codebook. You can insert the
new variable in the middle of the codebook by using the
WRITE command instead of the SAVE command. If you had 100
variables in the codebook and you wanted the new Number
variable to become the 26th variable, the commands would
be:
STUDY
Research
NEW (N2) "Number" Special New Variable
WRITE Research V1 - V25 Number V26 - V100
..
The above commands are "risky"
because a mistake in the WRITE command might cause a loss
of data. For example, if you made a typo in the WRITE
command and inadvertently left out the number
"5", there would be a loss of variables 3
through 25 in both the codebook and data files:
WRITE
Research V1 - V2 Number V26 - V100
(Bad)
A safer way is to use the WRITE command
to create a new codebook and data file rather than
replacing the existing file. The following procedure
creates a new codebook and data file called RESEARCH-2.
The orignal codebook and data file will not be altered.
You could then create a data entry form for RESEARCH-2:
STUDY
Research
NEW (N2) "Number" Special New Variable
WRITE Research-2 V1 - V25 Number V26 - V100
..
For more information on creating and
saving new variables, see the NEW, LET, COMPUTE, and
WRITE commands.
Top
QUESTION 12
- How can I import a fixed format sequential ASCII data
file into StatPac?
ANSWER
- Data files already in sequential ASCII fixed
format do not usually need any conversion to be used by
StatPac. The only requirement is that they have a .dat
extension. First, design a codebook with StatPac so that
the field widths for each variable are exactly the same
as the data file you will be using. Then copy the data
file to the same folder as the codebook and rename it so
it has the same prefix as the codebook and a .dat
extension. That's all there is to it.
As a final check, you can run the utility
program to check a codebook and data file for errors
(Analysis, Utilities, Codebook, Check Codebook and Data).
If no errors are reported, the length of each data record
matches the length defined by the codebook, and you can
be assured that the codebook design and data file will
interface properly.
If a data file is in any format other
than fixed format sequential ASCII, you must use the
import program to import the file. The import program
will create a new data file and new codebook that
best accommodates the format of the data being imported.
You could then add variable and value labeling to the
codebook.
Top
QUESTION 13
- I ran an analysis that creates new variables and found
that some of the computations were wrong. I fixed the
procedure and tried to re-run it but it keeps giving me a
"duplicate variable" message.
ANSWER
-When you used the SAVE keyword, the new
variables were saved in the codebook and data file...even
though the computations were not correct. When you try to
re-run the procedure, StatPac thinks you are attempting
to create more new variables with the same names. To fix
the problem, comment out the NEW keywords by placing an
apostrophe at the beginning of the NEW lines. Then re-run
the procedure.
Top
QUESTION 14
- I have data files that I want to merge together. How
can I combine them into one file so that I can analyze
them together as one group of data?
ANSWER
- When the data files contain identical
variables in the same order, the data files can by joined
by a process called concatenation. Usually, the
data files are another administration of the same survey
to a different group of people. To merge the files, in
the Analysis program, select Utilities, Merge,
Concatenate Data Files. For example, suppose you
administered a consumer survey at three different
shopping malls. The data file names are Mall-1.dat,
Mall-2.dat, and Mall-3.dat. The codebook was the same for
all three surveys (Mall-Survey.cod).
In many studies, it may also be important
to know which data file each record came from after the
data is merged. For example, if the purpose of the study
were to identify differences between the shoppers at the
different malls, it would be important that the final
merged data file contained a variable that identified
each respondent from Mall 1, 2 or 3. If the original data
files do not already contain a group identifier variable,
it can be added by running procedures to create the new
variable, assign value labels to it, and assign the
appropriate value to each record in the data files. This
must be done before concatenating the data files. For
this example, the procedures might be:
STUDY
Mall-Survey
DATA Mall-1
COMPUTE (N1) Location = 1
LABELS Location (1=Mall 1)(2=Mall 2)(3=Mall 3)
WRITE File-1
..
STUDY Mall-Survey
DATA Mall-2
COMPUTE (N1) Location = 2
LABELS Location (1=Mall 1)(2=Mall 2)(3=Mall 3)
WRITE File-2
..
STUDY Mall-Survey
DATA Mall-3
COMPUTE (N1) Location = 3
LABELS Location (1=Mall 1)(2=Mall 2)(3=Mall 3)
WRITE File-3
..
After running the three procedures, each
data file would contain a new variable called Location.
This variable would have a value of 1 for all the records
in the File-1.dat, 2 for all the records in the
File-2.dat, and 3 for all the records in the File-3.dat..
The data files could then be concatenated into a single
large data file. You would concatenate File-1.dat,
File-2.dat and File-3.dat into a new data file called
Combined.dat. Subsequent analyses could use the DATA
command to specify the concatenated data file as the one
to be analyzed. All three codebooks (File-1.cod,
File-2.cod and File-3.cod) would be identical, so you
could use any of them in the STUDY command.
STUDY
File-1
DATA Combined
The concatenation method of creating a
merged data file is used only when the data files contain
exactly the same variables in the same order.
Often, subsequent administrations of a
survey will contain revised and new questions. Although
most of the information is the same, small differences
make it impossible to just use concatenation The first
step in merging this kind of data is to identify the
variables that are common to both surveys. Next, run one
or more procedures using the WRITE keyword to create
subfiles that only consist of the common variables (those
variables that are identical in each study).
STUDY
FirstStudy
WRITE File-1 V4 V2 V12 - V22
..
STUDY SecondStudy
WRITE File-2 V7 V2 V15-V25
..
Finally, use concatenation to merge the
data files. In this example, you would merge File1.dat
and File-2.dat into a new larger file called
CommonVars.dat. You could then perform the analysis on
the combined data by beginning the procedure file with
these commands:
STUDY
File-1
DATA CommonVars
The other type of merge that StatPac can
perform is for a matched pairs or pre/post type of
experiment. When two or more data files represent the
same individuals, but different variables, you should not
use concatenation Instead, you would use the MERGE
keyword. Examples are before and after surveys, client
follow-up surveys, etc. The data files may contain the
same or different variables. The key point is that
information on a particular individual is in each data
file.
If each data file contains exactly the
same number of records in the same order, you can use the
MERGE command to merge the files without any additional
steps. For example, suppose you have pretest and posttest
surveys for the same group of people and the records in
the data files are in the same order (i.e., the first
record in the PreTest file is John Jones, and the first
record in the PostTest file is John Jones; the second
record in the PreTest file is Mary Smith, and the second
record in the PostTest file is Mary Smith, etc.). The
command to merge the posttest data into the pretest data
would be:
STUDY
PreTest
MERGE PostTest
..
If the data files contain records that
are not in the same order, or if there are not the same
number of records in each data file, then all the files
must contain a unique ID variable that will allow you to
match up data in the files. First you will have to sort
all the files by the ID variable. It is OK if a data file
does not contain a matching record for each record in the
other file(s) (e.g., a respondent dropped out of the
experiment). They just have to be in ascending sorted
order. An example would be:
STUDY
PreTest
SORT (A) ID
SAVE
..
STUDY PostTest
SORT (A) ID
SAVE
..
After the data has been sorted, select
Analysis, Utility, Merge, Restructure/Merge to perform
the merge using ID as the common variable. That is, the
ID number will be used to match up the records from each
data file. For more information on the merge utility
program, see the Utilities section of the on-line help.
Top
QUESTION 15
- One of the variables in my study has an
"other" category and a place for the respondent
to write in their answer. How do I include this is the
study design?
ANSWER
- A variable in StatPac is a "piece of
information". In this question, you really have two
pieces of information, and thus, two variables. The first
variable is the one with the defined response codes. The
second is the "other" response.
For example, the following question has
four response categories:
Who would you vote for to
be the next president of our club?
1=Sally Nelson
2=Jim French
3=Brenda Johnson
4=Other Specify:
__________________________________
Two variables would be specified in the
study design to hold the information for this question.
The first variable would be a numeric one-column
variable, and the second would be an alpha variable
(about forty columns). Skip codes could be used to bypass
the open-ended variable if 1, 2, or 3 is entered for the
first variable.
1=Sally Nelson ;3
2=Jim French ;3
3=Brenda Johnson ;3
4=Other Specify:
__________________________________
Top
|