How to highlight the diagonal of pre-post table

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

How to highlight the diagonal of pre-post table

Art Kendall
Consider a crosstab or table where the values on the row and column are the
same. For example, pre-post repeated measurement where cases were households
and the count of occupants were taken before and after a disaster like
Hurricane Katrina.






-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to highlight the diagonal of pre-post table

Jon Peck
Easy to do with a small custom function.  Here's a usage example.
CROSSTABS
    /TABLES=workhard BY helpoth
    /CELLS=COUNT EXPECTED. 
    
    SPSSINC MODIFY TABLES subtype="'Crosstabulation'"
    SELECT=0 
    DIMENSION= COLUMNS LEVEL = -1
    PROCESS = PRECEDING 
    /STYLES  APPLYTO=DATACELLS 
    CUSTOMFUNCTION="diagonals.diagonals".

Sending the code separately.  Save it where Python can find it.

This makes the diagonals yellow, but it would be easy to choose different highlighting for the background
or the text.  It allows for multiple rows of statistics.

On Sun, Apr 25, 2021 at 8:52 AM Art Kendall <[hidden email]> wrote:
Consider a crosstab or table where the values on the row and column are the
same. For example, pre-post repeated measurement where cases were households
and the count of occupants were taken before and after a disaster like
Hurricane Katrina.






-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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


--
Jon K Peck
[hidden email]

===================== 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: How to highlight the diagonal of pre-post table

Art Kendall
Thank you.

For the list archives:

Such a procedure would also be useful in looking at principal axis factor
analysis where the input matrix has the communalities on the diagonal rather
than 1.00 which is on the diagonal of the input matrix of principal
components.



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to highlight the diagonal of pre-post table

Art Kendall
Correlations or PROXIMITIYS also.
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to highlight the diagonal of pre-post table

Art Kendall
The python code stopped working. Perhaps I messed up the spacing or something.
I attaching
a screen snip that shows where the attachment is found
a SAV file
to_show.sav

Screenshot_2021-09-08_142231.jpg

diagonals.py
GET
  FILE='C:\Users\Art\Desktop\XX pieces\to show.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
CROSSTABS
    /TABLES= P#Members.1 BY P#Members.3
    /CELLS=COUNT.
   SPSSINC MODIFY TABLES subtype="'Crosstabulation'"
    SELECT=0
    DIMENSION= COLUMNS LEVEL = -1
    PROCESS = ALL
    /STYLES  APPLYTO=DATACELLS
    CUSTOMFUNCTION="diagonals.diagonals".
Art Kendall
Social Research Consultants