Transform variable

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

Transform variable

Martin Cernvall

Hi,

 

I have a questionnaire with 17 items on a scale ranging from 1-5. The scale has three factors (1-5, 6-12, 13-17). Now, I would like to create a dichotomous variable (0 or 1) based on the criteria that one scores ≥ 3 on at least one of items 1-5, ≥ 3 on at least three of items 6-12 and ≥ 3 on at least two of items 13-17.

 

Any suggestions on syntax that could be used to compute this type of variable?

 

The dataset is arranged as follows

 

      item1   item2   item3…   item17   NewVar

1

2

3

4

5

 

 

 

Thanks in advance!

 

Martin

Reply | Threaded
Open this post in threaded view
|

Re: Transform variable

Joost van Ginkel
Dear Martin,
 
Suppose your items are named V1 to V17 and you want to call the dichotomous variable "dichotomous". Then you can do the following:

COUNT countscale1=V1 to V5 (3 thru Highest).
COUNT countscale2=V6 to V12 (3 thru Highest).
COUNT countscale3=V13 to V17 (3 thru Highest) .
COMPUTE dichotomous = 0.
IF ((countscale1 >= 1) &  (countscale2 >= 3) &  (countscale3 >= 2)) dichotomous =1 .
EXECUTE.
DELETE VARIABLES countscale1 to countscale3 .
 
(the last line is optional).
 
Good luck.
 
Best regards,
 
Joost van Ginkel

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Martin Cernvall
Sent: 13 April 2010 16:18
To: [hidden email]
Subject: Transform variable

Hi,

 

I have a questionnaire with 17 items on a scale ranging from 1-5. The scale has three factors (1-5, 6-12, 13-17). Now, I would like to create a dichotomous variable (0 or 1) based on the criteria that one scores ≥ 3 on at least one of items 1-5, ≥ 3 on at least three of items 6-12 and ≥ 3 on at least two of items 13-17.

 

Any suggestions on syntax that could be used to compute this type of variable?

 

The dataset is arranged as follows

 

      item1   item2   item3…   item17   NewVar

1

2

3

4

5

 

 

 

Thanks in advance!

 

Martin

**********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the system manager.

**********************************************************************

 

Reply | Threaded
Open this post in threaded view
|

Re: Transform variable

John F Hall
Hope he hasn't got 98 and 99 as missing otherwise he'll be in real trouble!
 
Incidentally, you can put all three countscales in one count statement, eg
 
COUNT countscale1=V1 to V5 (3 thru Highest)
 /countscale2=V6 to V12 (3 thru Highest)
 /countscale3=V13 to V17 (3 thru Highest).
 
Saves a few key depressions
----- Original Message -----
Sent: Tuesday, April 13, 2010 4:43 PM
Subject: Re: Transform variable

Dear Martin,
 
Suppose your items are named V1 to V17 and you want to call the dichotomous variable "dichotomous". Then you can do the following:

COUNT countscale1=V1 to V5 (3 thru Highest).
COUNT countscale2=V6 to V12 (3 thru Highest).
COUNT countscale3=V13 to V17 (3 thru Highest) .
COMPUTE dichotomous = 0.
IF ((countscale1 >= 1) &  (countscale2 >= 3) &  (countscale3 >= 2)) dichotomous =1 .
EXECUTE.
DELETE VARIABLES countscale1 to countscale3 .
 
(the last line is optional).
 
Good luck.
 
Best regards,
 
Joost van Ginkel

Joost R. Van Ginkel, PhD
Leiden University
Faculty of Social and Behavioural Sciences
Data Theory Group
PO Box 9555
2300 RB Leiden
The Netherlands
Tel: +31-(0)71-527 3620
Fax: +31-(0)71-527 1721

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Martin Cernvall
Sent: 13 April 2010 16:18
To: [hidden email]
Subject: Transform variable

Hi,

 

I have a questionnaire with 17 items on a scale ranging from 1-5. The scale has three factors (1-5, 6-12, 13-17). Now, I would like to create a dichotomous variable (0 or 1) based on the criteria that one scores ≥ 3 on at least one of items 1-5, ≥ 3 on at least three of items 6-12 and ≥ 3 on at least two of items 13-17.

 

Any suggestions on syntax that could be used to compute this type of variable?

 

The dataset is arranged as follows

 

      item1   item2   item3…   item17   NewVar

1

2

3

4

5

 

 

 

Thanks in advance!

 

Martin

**********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the system manager.

**********************************************************************

 

Reply | Threaded
Open this post in threaded view
|

Re: Transform variable

Richard Ristow
In reply to this post by Joost van Ginkel
At 10:43 AM 4/13/2010, Ginkel, Joost van wrote:

Suppose your items are named V1 to V17 and you want to call the dichotomous variable "dichotomous". Then you can do the following:

COUNT countscale1=V1  to V5  (3 thru Highest).
COUNT countscale2=V6  to V12 (3 thru Highest).
COUNT countscale3=V13 to V17 (3 thru Highest) .
COMPUTE dichotomous = 0.
IF ((countscale1 >= 1)
  & (countscale2 >= 3)
  & (countscale3 >= 2)) dichotomous =1 .
EXECUTE.
DELETE VARIABLES countscale1 to countscale3 .
 
Hoping you don't mind code suggestions -- a very easy change is to COUNT into scratch variables, which don't have to be deleted:

COUNT #countscale1=V1  to V5  (3 thru Highest).
COUNT #countscale2=V6  to V12 (3 thru Highest).
COUNT #countscale3=V13 to V17 (3 thru Highest) .
COMPUTE dichotomous = 0.
IF ((#countscale1 >= 1)
  & (#countscale2 >= 3)
  & (#countscale3 >= 2)) dichotomous =1 .

The EXECUTE is unnecessary.
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD