Limiting # of decimal places in table output

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

Limiting # of decimal places in table output

D.R. Wahlgren
Gang,
Is there any way to set a limit on the number of decimal places in
frequency output?  I have some variables for which most categories
have one decimal place, but a small portion of them (about 20%) have
about 16 decimal places.  These tables would be a lot cleaner if I
could set an upper limit of 3 decimal places.

Note, I don't want to force *all* output to 3 places--I don't want to
end up with all of my 3's becoming 3.000, for example.  I just want
to cut off any values that extend that far.

I couldn't find anything in the preferences or in editing an output
table itself.  Best I could find was a script
(http://pages.infinit.net/rlevesqu/Scripts/PivotTables/SetNumberOfDecimalsInPivotTable.txt)
which is way above and beyond what I want to get involved with for
this.  I also don't want to have to reformat all of my variables--it
would be best if this was just an SPSS setting that would apply to
any and all analyses I run.

thanks,
Dennis

=====================
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: Limiting # of decimal places in table output

ViAnn Beadle
The display format of the variable controls the display of decimal digits
within the frequency table. Summary statistics get a few digits of extra
precision.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
D.R. Wahlgren
Sent: Wednesday, June 10, 2009 4:22 PM
To: [hidden email]
Subject: Limiting # of decimal places in table output

Gang,
Is there any way to set a limit on the number of decimal places in
frequency output?  I have some variables for which most categories
have one decimal place, but a small portion of them (about 20%) have
about 16 decimal places.  These tables would be a lot cleaner if I
could set an upper limit of 3 decimal places.

Note, I don't want to force *all* output to 3 places--I don't want to
end up with all of my 3's becoming 3.000, for example.  I just want
to cut off any values that extend that far.

I couldn't find anything in the preferences or in editing an output
table itself.  Best I could find was a script
(http://pages.infinit.net/rlevesqu/Scripts/PivotTables/SetNumberOfDecimalsIn
PivotTable.txt)
which is way above and beyond what I want to get involved with for
this.  I also don't want to have to reformat all of my variables--it
would be best if this was just an SPSS setting that would apply to
any and all analyses I run.

thanks,
Dennis

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

=====================
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: Limiting # of decimal places in table output

D.R. Wahlgren
At 6:07 PM -0600 6/10/09, ViAnn Beadle wrote:
>The display format of the variable controls the display of decimal digits
>within the frequency table. Summary statistics get a few digits of extra
>precision.

Thanks again, ViAnn. I was hoping to avoid having to format variables
every time I work with a new data set, but it looks like that is the
only way to change the output.  Unless there is a way to forma all
numeric vars at one time in syntax, it won't be worth the trouble.
Would be nice if there was a simple setting in the output preferences.

Dennis

=====================
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: Limiting # of decimal places in table output

Peck, Jon
There is always the SPSSINC MODIFY TABLES extension command available from SPSS Developer Central.  It can set the decimal format for selected columns in a particular table or for all tables in the Viewer of specified types.
It requires at leave v17 and the Python programmability plugin.  I can send you specific syntax if you want to go that route.
Regards,
Jon Peck

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of D.R. Wahlgren
Sent: Wednesday, June 10, 2009 6:31 PM
To: [hidden email]
Subject: Re: [SPSSX-L] Limiting # of decimal places in table output

At 6:07 PM -0600 6/10/09, ViAnn Beadle wrote:
>The display format of the variable controls the display of decimal digits
>within the frequency table. Summary statistics get a few digits of extra
>precision.

Thanks again, ViAnn. I was hoping to avoid having to format variables
every time I work with a new data set, but it looks like that is the
only way to change the output.  Unless there is a way to forma all
numeric vars at one time in syntax, it won't be worth the trouble.
Would be nice if there was a simple setting in the output preferences.

Dennis

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

=====================
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: Limiting # of decimal places in table output

D.R. Wahlgren
At 7:51 PM -0500 6/10/09, Peck, Jon wrote:
>There is always the SPSSINC MODIFY TABLES extension command
>available from SPSS Developer Central.  It can set the decimal
>format for selected columns in a particular table or for all tables
>in the Viewer of specified types.
>It requires at leave v17 and the Python programmability plugin.  I
>can send you specific syntax if you want to go that route.
>Regards,
>Jon Peck

Thanks, Jon.  I'm using v16 Mac, so I'll have to wait it out.
Dennis

=====================
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: Limiting # of decimal places in table output

Albert-Jan Roskam
In reply to this post by D.R. Wahlgren
Hi,

The following sets the format of all numerical vars, but it displays both 3.0001 and 3.0000 as 3, which may not be what you want.

import spss, spssaux
spss.Submit("formats " + " ".join([v.VariableName for v in spssaux.VariableDict(variableType="numeric")]) + " (f5).")

Cheers!!
Albert-Jan

--- On Thu, 6/11/09, D.R. Wahlgren <[hidden email]> wrote:

> From: D.R. Wahlgren <[hidden email]>
> Subject: Re: Limiting # of decimal places in table output
> To: [hidden email]
> Date: Thursday, June 11, 2009, 3:03 AM
> At 7:51 PM -0500 6/10/09, Peck, Jon
> wrote:
> >There is always the SPSSINC MODIFY TABLES extension
> command
> >available from SPSS Developer Central.  It can set
> the decimal
> >format for selected columns in a particular table or
> for all tables
> >in the Viewer of specified types.
> >It requires at leave v17 and the Python programmability
> plugin.  I
> >can send you specific syntax if you want to go that
> route.
> >Regards,
> >Jon Peck
>
> Thanks, Jon.  I'm using v16 Mac, so I'll have to wait
> it out.
> Dennis
>
> =====================
> 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
>

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