GROUPS error with independent t-test

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

GROUPS error with independent t-test

melissaj
I get the following error after attempting to run an independent t-test in SPSS: The GROUPS subcommand specifies an unknown variable or a long string variable. This subcommand must specify either a numeric variable or a short string variable. Text found: Condition

This is the syntax I used:
T-TEST GROUPS=Condition('1' '2')
  /MISSING=ANALYSIS
  /VARIABLES=PostMotivation
  /CRITERIA=CI(.95).

I see this has been posted about before, but I haven't found a solution that fits my situation. My two groups are coded only as 1s and 2s.

I'm a PhD student, but SPSS is the bane of my existence, so feel free to dumb down your answers as much as possible! I hope someone can help and thank you in advance.
Reply | Threaded
Open this post in threaded view
|

Re: GROUPS error with independent t-test

Bruce Weaver
Administrator
Try this:

ALTER TYPE Condition (f1). /* This assumes 1-digit condition numbers.

T-TEST GROUPS=Condition(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=PostMotivation
  /CRITERIA=CI(.95).

Note that the quotes around the condition numbers (1 and 2) have to be removed when Condition is a numeric variable.


melissaj wrote
I get the following error after attempting to run an independent t-test in SPSS: The GROUPS subcommand specifies an unknown variable or a long string variable. This subcommand must specify either a numeric variable or a short string variable. Text found: Condition

This is the syntax I used:
T-TEST GROUPS=Condition('1' '2')
  /MISSING=ANALYSIS
  /VARIABLES=PostMotivation
  /CRITERIA=CI(.95).

I see this has been posted about before, but I haven't found a solution that fits my situation. My two groups are coded only as 1s and 2s.

I'm a PhD student, but SPSS is the bane of my existence, so feel free to dumb down your answers as much as possible! I hope someone can help and thank you in advance.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: GROUPS error with independent t-test

melissaj
Bruce, thank you so much for your help. That did the trick!

I've never encountered this issue before. So that I'm clear in the future, this error is because I coded the groups numerically and did not correctly specify as such?

Thanks again,
Melissa


On Sun, Feb 9, 2014 at 9:30 PM, Bruce Weaver [via SPSSX Discussion] <[hidden email]> wrote:
Try this:

ALTER TYPE Condition (f1). /* This assumes 1-digit condition numbers.

T-TEST GROUPS=Condition(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=PostMotivation
  /CRITERIA=CI(.95).

Note that the quotes around the condition numbers (1 and 2) have to be removed when Condition is a numeric variable.


melissaj wrote
I get the following error after attempting to run an independent t-test in SPSS: The GROUPS subcommand specifies an unknown variable or a long string variable. This subcommand must specify either a numeric variable or a short string variable. Text found: Condition

This is the syntax I used:
T-TEST GROUPS=Condition('1' '2')
  /MISSING=ANALYSIS
  /VARIABLES=PostMotivation
  /CRITERIA=CI(.95).

I see this has been posted about before, but I haven't found a solution that fits my situation. My two groups are coded only as 1s and 2s.

I'm a PhD student, but SPSS is the bane of my existence, so feel free to dumb down your answers as much as possible! I hope someone can help and thank you in advance.
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/GROUPS-error-with-independent-t-test-tp5724410p5724411.html
To unsubscribe from GROUPS error with independent t-test, click here.
NAML



--
Melissa A. (Hoelzle) Jensen
--
PhD Candidate
Clinical Psychology Graduate Student
University of Toledo
--
Clinical Psychology Extern
St. Luke's and University of Toledo Medical Campus Hospital
Behavioral Health

This message is a PRIVILEGED AND CONFIDENTIAL communication.  This information is intended only for the use of the individual or entity named above.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of these documents is strictly prohibited.   If you have received this information in error, please notify the sender immediately and then delete the message from your system. 
Reply | Threaded
Open this post in threaded view
|

Re: GROUPS error with independent t-test

Bruce Weaver
Administrator
Look at your error message again--unlike some error messages, this one is pretty clear:

Error: The GROUPS subcommand specifies an unknown variable or a long string variable. This subcommand must specify either a numeric variable or a short string variable. Text found: Condition

Your file did contain a variable called Condition, so you know that it was not a case of failing to find the variable.  Therefore, Condition must have been a so-called "long string" variable.  Long string variables are not allowed as the grouping variable for the T-TEST procedure.  The ALTER TYPE command changed it to a numeric variable, which is allowed.

HTH.


melissaj wrote
Bruce, thank you so much for your help. That did the trick!

I've never encountered this issue before. So that I'm clear in the future,
this error is because I coded the groups numerically and did not correctly
specify as such?

Thanks again,
Melissa


On Sun, Feb 9, 2014 at 9:30 PM, Bruce Weaver [via SPSSX Discussion] <
[hidden email]> wrote:

> Try this:
>
> ALTER TYPE Condition (f1). /* This assumes 1-digit condition numbers.
>
> T-TEST GROUPS=Condition(1 2)
>   /MISSING=ANALYSIS
>   /VARIABLES=PostMotivation
>   /CRITERIA=CI(.95).
>
> Note that the quotes around the condition numbers (1 and 2) have to be
> removed when Condition is a numeric variable.
>
>
> melissaj wrote
> I get the following error after attempting to run an independent t-test in
> SPSS: The GROUPS subcommand specifies an unknown variable or a long string
> variable. This subcommand must specify either a numeric variable or a short
> string variable. Text found: Condition
>
> This is the syntax I used:
> T-TEST GROUPS=Condition('1' '2')
>   /MISSING=ANALYSIS
>   /VARIABLES=PostMotivation
>   /CRITERIA=CI(.95).
>
> I see this has been posted about before, but I haven't found a solution
> that fits my situation. My two groups are coded only as 1s and 2s.
>
> I'm a PhD student, but SPSS is the bane of my existence, so feel free to
> dumb down your answers as much as possible! I hope someone can help and
> thank you in advance.
>
>  --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
>
>
> *NOTE: My Hotmail account is not monitored regularly. To send me an
> e-mail, please use the address shown above. *
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://spssx-discussion.1045642.n5.nabble.com/GROUPS-error-with-independent-t-test-tp5724410p5724411.html
>  To unsubscribe from GROUPS error with independent t-test, click here<http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724410&code=bWVsaXNzYS5hLmplbnNlbjFAZ21haWwuY29tfDU3MjQ0MTB8MzU0Mzc5OTIy>
> .
> NAML<http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Melissa A. (Hoelzle) Jensen
--
PhD Candidate
Clinical Psychology Graduate Student
University of Toledo
--
Clinical Psychology Extern
St. Luke's and University of Toledo Medical Campus Hospital
Behavioral Health

*This message is a PRIVILEGED AND CONFIDENTIAL communication.  This
information is intended only for the use of the individual or entity named
above.  If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or action taken in reliance on the
contents of these documents is strictly prohibited.   If you have received
this information in error, please notify the sender immediately and then
delete the message from your system. *
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: GROUPS error with independent t-test

wgnuez
Hi,

I am getting the same error using Diet as string variable (nominal).

Warnings
The GROUPS subcommand specifies an unknown variable or a long string variable. This subcommand must specify either a numeric variable or a short string variable. Text found: Diet
Execution of this command stops.

My syntax is:

T-TEST GROUPS=Diet('XP' 'RC')
  /MISSING=ANALYSIS
  /VARIABLES=@140
  /CRITERIA=CI(.95).

Never had this issue before. I tried ALTER TYPE but it did not work. Any help?
Cheers,
Waldo
Reply | Threaded
Open this post in threaded view
|

Re: GROUPS error with independent t-test

PRogman
If Diet is a string with two letters; what is the corresponding numeric values?
Try
RECODE Diet ('XP'=1) ('RC'=2) INTO Diet_numeric.
T-TEST GROUPS=Diet_numeric (1 2) ...
Look up ALTER TYPE and RECODE.
/PR
Reply | Threaded
Open this post in threaded view
|

Re: GROUPS error with independent t-test

wgnuez
Thanks!
It worked, but I do not understand why then the syntax below works without doing any modification. It is the same as the previous one but I just changed the independent variable to ploidy (instead of diet), this one being string.
T-TEST GROUPS=Ploidy('D' 'T')
  /MISSING=ANALYSIS
  /VARIABLES=@140 @170
  /CRITERIA=CI(.95).
Cheers,
W