Strings need to be enclosed in quotes, i.e.:
Code:COMPUTE filter_$=(DEGC = 'AAS').
Hello all,
I am want to run one sample t-test for groups of students based on how they performed on a test. I need to run t-tests on different groups of students (students with different levels of degrees, different majors, etc) but am having trouble selecting and filtering cases. I uploaded the excel file with my data into SPSS, tried to sort by the type of degree (AAS, AS, AST) only to get a host of error messages
Here is my syntaxUSE ALL.
COMPUTE filter_$=(DEGC = AAS).
>Error # 4285 in column 26. Text: AAS
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>This command not executed.
VARIABLE LABEL filter_$ 'DEGC = AAS (FILTER)'.
>Warning # 4461 in column 16. Text: filter_$
>An unknown variable name was specified on the VAR LABELS command. The name
>and the label will be ignored.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
>Warning # 4474. Command name: VALUE LABELS
>The (ADD) VALUE LABELS command specifies an unknown variable name. The name
>will be ignored.
>The error is associated with 'filter_$'
FORMAT filter_$ (f1.0).
>Error # 4820 in column 8. Text: filter_$
>A variable named on the FORMATS, PRINT FORMATS, or WRITE FORMATS command has
>not yet been defined.
>This command not executed.
FILTER BY filter_$.
>Error # 4872 in column 11. Text: filter_$
>The name of the filter variable is undefined. Either the variable has not
>been defined or its name has been misspelled.
>This command not executed.
EXECUTE .
DATASET ACTIVATE DataSet2.
USE ALL.
COMPUTE filter_$=(DEGC = AAS).
VARIABLE LABEL filter_$ 'DEGC = AAS (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
I also uploaded the excel file with my data.
Any help would be greatly appreciated.
Joe
Strings need to be enclosed in quotes, i.e.:
Code:COMPUTE filter_$=(DEGC = 'AAS').
Just to let you know a way to do this that I find sometimes easier/faster than filtering. You can split a file and SPSS will than execute everything for every part of the file:
In your case that would look like this:
Code:SORT CASES BY DEGC. SPLIT FILE BY DEGC. /* here you can put everything that you want to be done for the different groups of students */ T-TEST ... SPLIT FILE OFF. /* this undoes the split */
Please be gracious in judging my english. (I am not a native speaker/writer.)
|
|