Date: Fri, 5 Oct 2007 11:17:21 +0200
Reply-To: Spousta Jan <JSpousta@CSAS.CZ>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Spousta Jan <JSpousta@CSAS.CZ>
Subject: Re: calculating an index
In-Reply-To: A<E72F29F51E19C04AB82262988638509A8A8172@barc-server.barc-intranet.de>
Content-Type: text/plain; charset="iso-8859-2"
If I understand it well, it should be something like this:
* lets try to compute the mean of all valid responses bigband to hvymetal in the standard file GSS93 subset.
* The weights of variables are as follows:
bigband 1
blugrass 2
country 2
blues 1
musicals 3
classicl 1
folk 2
jazz 1
opera 1
rap 1
hvymetal 1
.
GET FILE='C:\Program Files\SPSS14\GSS93 subset.sav' /keep id bigband to hvymetal .
compute sumwgts = 0 /*sum of weights of valid responses in the row*/.
do repe x = bigband to hvymetal / w = 1 2 2 1 3 1 2 1 1 1 1.
- compute x = x * w.
- if not missing(x) sumwgts = sumwgts + w.
end repe.
* delete value labels .
val lab bigband to hvymetal .
compute sumansw = sum(bigband to hvymetal).
var lab sumwgts "Sum of weights of valid responses in the row" / sumansw "Sum of weighted answers in the row".
compute index = 1.
DATASET DECLARE aggregind.
AGGREGATE /OUTFILE='aggregind' /BREAK=index /sumwgtss = SUM(sumwgts) /sumansws = SUM(sumansw).
DATASET ACTIVATE aggregind.
compute index = sumansws / sumwgtss.
exe.
Of course it can be done in other ways, too. E.g. using Restructure.
Have a nice weekend,
Jan
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Dirk Sebastian Friedrich
Sent: Friday, October 05, 2007 10:35 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: calculating an index
Thanks Hector, thanks Richard,
unfortunately your proposed solution doesn't give me the solution to my problem. Maybe I haven't been clear enough.
In easy words: I want to calculated the mean of more than one columns!
What I did with: "COMPUTE
INDEX=MEAN(QUESTION1,QUESTION2,QUESTION3,QUESTION4,QUESTION5)." Was computing the mean per row. Afterwards I could have calculated the mean of all the means for getting an index. But this index wouldn't consider left answers in the single questions and would give each mean per row the same weight. That's exactly what I don't want to do.
There must be a way to get the mean of more than one columns which then respects the numbers of answers n.
Thanks for your help.
Dirk
btw: The Index is more complex with weights for different answer options. What I am really doing is asking you about getting the mean of the weights. But it wouldn't change anything on the method.
_____
Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.
This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.
-.- --