Can I have more than one rowCategory in spssaux.GetValuesFromXMLWorkspace?

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

Can I have more than one rowCategory in spssaux.GetValuesFromXMLWorkspace?

Ruben Geert van den Berg
Dear all,

If I have a means table like so

means v1 by v2 by v3.

each mean will have two row categories (v2 and v3). If I want to retrieve the means for each combination of v2 and v3, can I somehow use spssaux.GetValuesFromXMLWorkspace for that? It seems like I can pass only one rowCategory into it, which suggests I'll need a temporary composite variable indicating the values of both v2 and v3.

TIA,

Ruben
Reply | Threaded
Open this post in threaded view
|

Re: Can I have more than one rowCategory in spssaux.GetValuesFromXMLWorkspace?

Jon K Peck
The GetValuesFromXMLWorkspace only supports one variable in the row dimension and one in the column dimension.  But you can get this information using the spss/EvaluateXPath api.  The tricky part of that is specifying the XPath expression to apply.

Here is an XPath expression that returns all the values in a means table.
//pivotTable//cell/@number
You would have to know the order to make sense of this.  If you just want the values of the mean statistic, you could get them like this.
//pivotTable//category[@text="Mean"]/cell/@number

If you also need the hierarchy of category identifiers, other XPath expressions can return these, but you may know this information in advance, so I'll await your response.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Ruben Geert van den Berg <[hidden email]>
To:        [hidden email],
Date:        06/07/2013 02:22 AM
Subject:        [SPSSX-L] Can I have more than one rowCategory in              spssaux.GetValuesFromXMLWorkspace?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Dear all,

If I have a means table like so

means v1 by v2 by v3.

each mean will have two row categories (v2 and v3). If I want to retrieve
the means for each combination of v2 and v3, can I somehow use
spssaux.GetValuesFromXMLWorkspace for that? It seems like I can pass only
one rowCategory into it, which suggests I'll need a temporary composite
variable indicating the values of both v2 and v3.

TIA,

Ruben



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Can-I-have-more-than-one-rowCategory-in-spssaux-GetValuesFromXMLWorkspace-tp5720623.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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


Reply | Threaded
Open this post in threaded view
|

Re: Can I have more than one rowCategory in spssaux.GetValuesFromXMLWorkspace?

jeakyung
Hi Jon,
I came across this post and I'm having the same issue. In my data structure, I have means by v1(RATING: 4 levels) by v2(Gender: 2 levels). 8 value.

In order to have the full hierarchy of category identifiers, I try to find the means first, and go up the XML tree to find the ancestor info.

xpath3="//category[@text='Mean']/ancestor::group[@varName='RATING'][1]/@label"
values3=spss.EvaluateXPath(handle,context,xpath3)

Give me the full list of V1 (8 of them)which is good;

However,
xpath4="//category[@text='Mean']/ancestor::group[@varName='Gender'][1]/@label"
values4=spss.EvaluateXPath(handle,context,xpath4)

only gives me the unique value of "Gender" (2 of them). It seems to me that even I want the "Gender" ancestor of all 8 means, spss.EvaluateXpath only gives the unique value.

Any suggestions? Thanks!

Cenran

Reply | Threaded
Open this post in threaded view
|

Automatic reply: Can I have more than one rowCategory in spssaux.GetValuesFromXMLWorkspace?

Kim Jinnett-2
I'm currently on vacation and will return to the office on Friday, July 12th. If you need to reach someone sooner please contact Janice Pearcy at [hidden email].

Thank you,
Kim Jinnett