+ Reply to Thread
Results 1 to 5 of 5

Thread: Issue selecting cases

  1. #1
    Points: 71, Level: 1
    Level completed: 43%, Points required for next Level: 29

    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Issue selecting cases



    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

    USE 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 .
    Here is my syntax

    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
    Attached Files

  2. #2
    Points: 1,494, Level: 21
    Level completed: 94%, Points required for next Level: 6

    Posts
    70
    Thanks
    0
    Thanked 27 Times in 25 Posts

    Re: Issue selecting cases

    Strings need to be enclosed in quotes, i.e.:

    Code: 
    COMPUTE filter_$=(DEGC = 'AAS').

  3. The Following 2 Users Say Thank You to helicon For This Useful Post:

    jbdet20 (07-14-2012), sg2kilo (07-16-2012)

  4. #3
    Points: 71, Level: 1
    Level completed: 43%, Points required for next Level: 29

    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Issue selecting cases

    Quote Originally Posted by helicon View Post
    Strings need to be enclosed in quotes, i.e.:

    Code: 
    COMPUTE filter_$=(DEGC = 'AAS').
    Of course its that easy.

    Thanks for your help.

  5. #4
    Points: 946, Level: 16
    Level completed: 46%, Points required for next Level: 54

    Location
    Vienna, Austria, Europe
    Posts
    50
    Thanks
    1
    Thanked 8 Times in 7 Posts

    Re: Issue selecting cases

    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.)

  6. The Following 2 Users Say Thank You to lorb For This Useful Post:

    jbdet20 (07-14-2012), sg2kilo (07-16-2012)

  7. #5
    Points: 71, Level: 1
    Level completed: 43%, Points required for next Level: 29

    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Issue selecting cases


    Quote Originally Posted by lorb View Post
    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 */
    Thanks I`ll give it a try.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats