Does anyone know how to hide small counts in spss 15?
In the current versions of SPSS, in a CTable you can write /HIDESMALLCOUNTS count=5(or whatever int you want to make as your lower limit), but that function is not in the documentation for SPSS 15 (and I can't for the life of me find an alternative from the manual) I tested to see whether it worked anyway and it just threw the incorrect syntax error. Is there an alternative? or will I just have to use a newer version of SPSS if I want to do this ? "Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever." |
HIDESMALLCOUNTS was released in v19...and there doesn't look like there was anything of the equivalent in v15.
http://publib.boulder.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help%2Fsyn_ctables.htm |
In reply to this post by Tom1234
A possible alternative is the SPSSINC CENSOR TABLES extension command. Not sure if this is available for SPSS v15 though.
Regards, Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Administrator
|
I don't recall EXTENSIONS being available in 15.
You could always write a BASIC (or python if you prefer) script to activate the table, traverse the DataCellArray and clobber anything you consider small.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
Lucky you,
I clocked it in at under 5 minutes ;-) I developed it in 11.5 (you may need to tickle it a bit for 15). -- Sub Main Dim pvt As PivotTable Dim i As Long With objSpssApp.GetDesignatedOutputDoc.Items For i=0 To .Count-1 If .GetItem(i).SPSSType=SPSSPivot Then Set pvt =.GetItem(i).Activate With pvt.DataCellArray For r=0 To .NumRows-1 For c=0 To .NumColumns-1 If .ValueAt(r,c) < 5 Then .ValueAt(r,c)=" " End If Next c Next r End With .GetItem(i).Deactivate End If Next i End With End Sub
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
Just tossed that little bugger into 21 and it worked without modification!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by Tom1234
If this is a one-time
run you could just manually edit the
cells. beware of situations where blanking the
cells but leaving the marginals would still
disclose info that should not be disclosed.
Art Kendall Social Research ConsultantsOn 4/24/2013 6:31 AM, Tom1234 [via SPSSX Discussion] wrote: Does anyone know how to hide small counts in spss 15?
Art Kendall
Social Research Consultants |
In reply to this post by Albert-Jan Roskam
Extension commands were first introduced
in V16, almost most current ones require V18. However, the scripting
apis necessary to do this work existed in V15, at least in Basic, so it
is theoretically possible to write a Basic script for this. Reproducing
the capabilities of CENSOR TABLES, though, would not be a trivial task.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Albert-Jan Roskam <[hidden email]> To: [hidden email], Date: 04/24/2013 05:12 AM Subject: Re: [SPSSX-L] Hide small counts in spss 15? Sent by: "SPSSX(r) Discussion" <[hidden email]> A possible alternative is the SPSSINC CENSOR TABLES extension command. Not sure if this is available for SPSS v15 though. Regards, Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: Tom1234 <[hidden email]> To: [hidden email] Sent: Wednesday, April 24, 2013 12:31 PM Subject: [SPSSX-L] Hide small counts in spss 15? Does anyone know how to hide small counts in spss 15? In the current versions of SPSS, in a CTable you can write /HIDESMALLCOUNTS count=5(or whatever int you want to make as your lower limit), but that function is not in the documentation for SPSS 15 (and I can't for the life of me find an alternative from the manual) I tested to see whether it worked anyway and it just threw the incorrect syntax error. Is there an alternative? or will I just have to use a newer version of SPSS if I want to do this ? ----- "Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever." -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Hide-small-counts-in-spss-15-tp5719674.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (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 |
In reply to this post by David Marso
Script ran fine, although it only removed the figures and not the columns, each column in the table has a Col% and Row% as a well as the count which I think is what is preventing your genius script from completing the task.
"Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever." |
Administrator
|
In reply to this post by Jon K Peck
Yes Jon,
I wrote one in 11.5 in about 5 minutes retested (unmodified) in 21 and posted here ;-) BASIC is not completely useless after all? ;-)
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
In reply to this post by Art Kendall
"beware of situations where blanking the cells but leaving the marginals would still disclose info that should not be disclosed."
Great point Art, I will leave it OP to modify my posted script accordingly. Should be pretty straightforward however my work is done here (on this thread).
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by David Marso
No, Basic is not useless. CENSOR
TABLES, though, does a lot more than this script.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: David Marso <[hidden email]> To: [hidden email], Date: 04/24/2013 06:58 AM Subject: Re: [SPSSX-L] Hide small counts in spss 15? Sent by: "SPSSX(r) Discussion" <[hidden email]> Yes Jon, I wrote one in 11.5 in about 5 minutes retested (unmodified) in 21 and posted here ;-) BASIC is not completely useless after all? ;-) Jon K Peck wrote > Extension commands were first introduced in V16, almost most current ones > require V18. However, the scripting apis necessary to do this work > existed in V15, at least in Basic, so it is theoretically possible to > write a Basic script for this. Reproducing the capabilities of CENSOR > TABLES, though, would not be a trivial task. > > > Jon Peck (no "h") aka Kim > Senior Software Engineer, IBM > peck@.ibm > phone: 720-342-5621 > > > > > From: Albert-Jan Roskam < > fomcl@ > > > To: > SPSSX-L@.uga > , > Date: 04/24/2013 05:12 AM > Subject: Re: [SPSSX-L] Hide small counts in spss 15? > Sent by: "SPSSX(r) Discussion" < > SPSSX-L@.uga > > > > > > A possible alternative is the SPSSINC CENSOR TABLES extension command. Not > sure if this is available for SPSS v15 though. > > Regards, > Albert-Jan > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > All right, but apart from the sanitation, the medicine, education, wine, > public order, irrigation, roads, a > fresh water system, and public health, what have the Romans ever done for > us? > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > From: Tom1234 < > tom@ > > > To: > SPSSX-L@.UGA > Sent: Wednesday, April 24, 2013 12:31 PM > Subject: [SPSSX-L] Hide small counts in spss 15? > > Does anyone know how to hide small counts in spss 15? > In the current versions of SPSS, in a CTable you can write > /HIDESMALLCOUNTS > count=5(or whatever int you want to make as your lower limit), but that > function is not in the documentation for SPSS 15 (and I can't for the life > of me find an alternative from the manual) I tested to see whether it > worked > anyway and it just threw the incorrect syntax error. > Is there an alternative? or will I just have to use a newer version of > SPSS > if I want to do this ? > > > > > ----- > > "Lo there do I see my father. Lo there do I see my mother and my sisters > and my brothers. Lo there do I see the line of my people, back to the > beginning. Lo, they do call to me, they bid me take my place among them, > in the Halls of Valhalla, where the brave may live...forever." > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/Hide-small-counts-in-spss-15-tp5719674.html > > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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 ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Hide-small-counts-in-spss-15-tp5719674p5719686.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 |
Administrator
|
I wrote this script in 5 minutes.
For anything more elaborate, contributions to my beer and Ramen fund are suggested ;-).
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by David Marso
Not entirely sure why but the line
With objSpssApp.GetDesignatedOutputDoc.Itemshas decided to throw an error.... Thought it might be to do with the ObjSpssApp object, so from what I remember about referencing the application via the scripting facility I quickly added: Dim objSpssApp As spsswinLib.Application16 Set objSpssApp = GetObject("","SPSS.Application16")to the top, which had no effect whatsoever. After 20 minutes trauling through the helpfiles I'm still stumped, might try again after Spss 21 is downloaded and ready to be used.
"Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever." |
Administrator
|
Weird! (especially since it ran in both v 11.5 and v 21.0.1 without modification).
If you just type in With objSPSSApp. after the dot (.) is typed you should get 'intellisense' window popping up with the available options. Among them will be GetDesignatedOutputDoc If you type another . you should have Items as an option. Maybe something is broken in v 15? Maybe see if there are other samples in the script directory and check to see that they work? You should not attempt to acquire a reference to the SPSSApplication via GetObject within te SPSS scripting environment. It should already be there as a global object.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
I checked the intellisense dropdowns and it all went exactly how you described,
however, as before when I ran the script I got this Error message: (10094) ActiveX Automation: Object var is 'Nothing'.
"Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever." |
Administrator
|
Really hard to say!
1. If you dig out other script examples (from the SPSS directory) can you get them to run? 2. Have you used scripting in 15 before with any success? After all, that nugget I sent is about as basic as it gets wrt ganking Pivot Tables. 3. Maybe somehow something fundamental got broken. Is reinstall an option? Maybe try stepping through the following functionally EQUIVALENT code. I obviously MUCH prefer the With version since we don't need to declare object variables (could even lose Dim pvt if I wanted to). Sub Main Dim pvt As PivotTable Dim objoutput As ISpssOutputDoc Dim objItems As ISpssItems Dim objItem As ISpssItem Dim objDataCells As ISpssDataCells Dim i As Long Set objoutput =objSpssApp.GetDesignatedOutputDoc Set objItems = objoutput.Items For i=0 To objItems.Count-1 Set objItem=objItems.GetItem(i) If objItem.SPSSType=SPSSPivot Then Set pvt =objItem.Activate Set objDataCells=pvt.DataCellArray For r=0 To objDataCells.NumRows-1 For c=0 To objDataCells.NumColumns-1 If objDataCells.ValueAt(r,c) < 5 Then objDataCells.ValueAt(r,c)=" " Next c Next r objItem.Deactivate End If Next i End Sub
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
After finding out the examples didn't even work I had a quick check of the dlls that were being used by the script, I checked the dependency and apparently I'm missing a whole bunch of dlls needed for them to work! Reinstall time I think
"Lo there do I see my father. Lo there do I see my mother and my sisters and my brothers. Lo there do I see the line of my people, back to the beginning. Lo, they do call to me, they bid me take my place among them, in the Halls of Valhalla, where the brave may live...forever." |
Free forum by Nabble | Edit this page |