Date: Mon, 10 May 2010 14:16:31 -0700
Reply-To: Bruce Weaver <bruce.weaver@hotmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Bruce Weaver <bruce.weaver@hotmail.com>
Subject: Re: Table of means
In-Reply-To: <77BE6EA83C0D4D69842C0D250DA7E0B7@ssw.buffalo.edu>
Content-Type: text/plain; charset=us-ascii
Gene Maguin wrote:
>
> Marcos,
>
> I'm going to assume that your data is in wide format (one row per person)
> rather than long format (12 rows per person). It sounds like the resulting
> table should look like
>
> Attrib 1 Attrib 2 Attrib 3 Attrib 4
> Brand 1 (mean)
> Brand 2
> Brand 3
>
> You can do this with the Means command if you restructure your file from
> wide to long. The problem is that the variable order in the file needs to
> be
> different. To fix this problem, you need to save file with the required
> order specified on the keep subcommand and then reopen that file (OR,
> manually reorder the columns in the data editor). However, it gets done
> the
> order needs to be
>
> brand1_attrib1
> brand2_attrib1
> brand3_attrib1
> brand1_attrib2
> brand2_attrib2
> brand3_attrib2
> brand1_attrib3
> brand2_attrib3
> brand3_attrib3
> brand1_attrib4
> brand2_attrib4
> brand3_attrib4
>
> Then do a varstocases.
>
> Vartocases /make attrib1 from brand1_attrib1 to brand3_attrib1/
> make attrib2 from brand1_attrib2 to brand3_attrib2/
> make attrib3 from brand1_attrib3 to brand3_attrib3/
> make attrib4 from brand1_attrib4 to brand3_attrib4/index=brand.
>
> With that done you use the following means command.
>
> Means attrib1 attrib2 attrib3 attrib4 by brand/cells=count mean stddev.
>
> I haven't tested this but, of course, I will respond to problems you have.
>
> Another alternative may be Ctables (complex tables); howerver, I don't
> have
> enough experience to know whether you can use Ctables without
> restructuring
> the dataset. If others know how, I also would be interested see how to do
> it.
>
> Gene Maguin
>
>
Hi Gene. Although it may be convenient to re-order the variables in some
cases*, I don't think it's necessary to do so. E.g., I think the following
will work without re-ordering the variables:
Vartocases /
make attrib1 from brand1_attrib1 brand2_attrib1 brand3_attrib1/
make attrib2 from brand1_attrib2 brand2_attrib2 brand3_attrib2/
make attrib3 from brand1_attrib3 brand2_attrib3 brand3_attrib3/
make attrib4 from brand1_attrib4 brand2_attrib4 brand3_attrib4/
index=brand.
* Obviously, if each MAKE sub-command was going to have a very long variable
list, re-ordering the variables to make the "var1 TO varX" approach possible
would be eminently sensible.
Cheers,
Bruce
-----
--
Bruce Weaver
bweaver@lakeheadu.ca
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.
--
View this message in context: http://old.nabble.com/Table-of-means-tp28513203p28517054.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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
|