computing every 30th item from a scale.

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

computing every 30th item from a scale.

msherman
Dear list. I have scale that consists of 5 independent domains and I
want to compute a total score for each domain.  The items for each
domain are arranged in a fixed sequence.  Item1(domain1) Item2(domain2)
Item3(domain3) Item4(domain4) Item5(domain5) Item6(domain1)
Item7(domain2) Item8(domain3) Item9(domain4) Item10(domain5)  etc.
Other than using the long and tedious listing of items that are
included in a domain is there an easier way to calculate a total score
for each domain.
The long way would be to do this.
Compute totaldomain1=sum.?(item1,item6,item11,item16,item21,etc).

Thanks,   martin sherman

Martin F. Sherman, Ph.D.
Professor of Psychology
Loyola College
Director of Masters Education: Thesis Track
Psychology Department
222 B Beatty Hall
4501 North Charles Street
Baltimore, MD 21210
 Martin F. Sherman, Ph.D.
Professor of Psychology
Director of Masters Education: Thesis Track
Loyola College
Psychology Department
222 B Beatty Hall
4501 North Charles Street
Baltimore, MD 21210

410 617-2417 (office)
410 617-5341 (fax)

[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: computing every 30th item from a scale.

Raynald Levesque
Hi Martin,

This is one way:

NEW FILE.
DATA LIST LIST /id .
BEGIN DATA
1
END DATA.

VECTOR item(45).
DEFINE !expand (root=!TOKENS(1)  /n1=!TOKENS(1) /n2=!TOKENS(1)
/delta=!TOKENS(1))
!DO !idx=!n1 !TO !n2 !BY !delta !IF (!idx !NE !n1) !THEN , !IFEND
!CONCAT(!root,!idx) !DOEND
!ENDDEFINE.

SET MPRINT=YES.
COMPUTE sum1=SUM( !expand root=item n1=1 n2=41 delta=5 ).
COMPUTE sum2=SUM( !expand root=item n1=2 n2=42 delta=5 ).
COMPUTE sum3=SUM( !expand root=item n1=3 n2=43 delta=5 ).
COMPUTE sum4=SUM( !expand root=item n1=4 n2=44 delta=5 ).


Extract fromn the output:

M>  COMPUTE sum1=SUM( item1 , item6 , item11 , item16 , item21 , item26 ,
item31 , item36 , item41 ).
M>  COMPUTE sum2=SUM( item2 , item7 , item12 , item17 , item22 , item27 ,
item32 , item37 , item42 ).
M>  COMPUTE sum3=SUM( item3 , item8 , item13 , item18 , item23 , item28 ,
item33 , item38 , item43 ).
M>  COMPUTE sum4=SUM( item4 , item9 , item14 , item19 , item24 , item29 ,
item34 , item39 , item44 ).

Cheers!

Raynald Levesque [hidden email]
Visit my SPSS site: http://www.spsstools.net



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Martin Sherman
Sent: October 10, 2006 11:43 AM
To: [hidden email]
Subject: computing every 30th item from a scale.

Dear list. I have scale that consists of 5 independent domains and I want to
compute a total score for each domain.  The items for each domain are
arranged in a fixed sequence.  Item1(domain1) Item2(domain2)
Item3(domain3) Item4(domain4) Item5(domain5) Item6(domain1)
Item7(domain2) Item8(domain3) Item9(domain4) Item10(domain5)  etc.
Other than using the long and tedious listing of items that are included in
a domain is there an easier way to calculate a total score for each domain.
The long way would be to do this.
Compute totaldomain1=sum.?(item1,item6,item11,item16,item21,etc).

Thanks,   martin sherman

Martin F. Sherman, Ph.D.
Professor of Psychology
Loyola College
Director of Masters Education: Thesis Track Psychology Department
222 B Beatty Hall
4501 North Charles Street
Baltimore, MD 21210
 Martin F. Sherman, Ph.D.
Professor of Psychology
Director of Masters Education: Thesis Track Loyola College Psychology
Department
222 B Beatty Hall
4501 North Charles Street
Baltimore, MD 21210

410 617-2417 (office)
410 617-5341 (fax)

[hidden email]