I know what you mean, but too many non-professionals need significance tests - the differences between "total" and "every category".
I find a way, syntax is :
COMPUTE ttl = 0 .
EXECUTE .
MRSETS /MCGROUP NAME=$test VARIABLES=ttl test LABEL='test' .
CTABLES
/VLABELS VARIABLES=$anal $test DISPLAY=DEFAULT
/TABLE $anal [C][COLPCT.COUNT PCT40.1, TOTALS[COUNT F40.0]] BY $test [C]
/SLABELS POSITION=ROW
/CATEGORIES VARIABLES=$anal EMPTY=INCLUDE TOTAL=YES POSITION=BEFORE LABEL="BASE"
/CATEGORIES VARIABLES=$test EMPTY=INCLUDE
/COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=NONE ORIGIN=COLUMN INCLUDEMRSETS=YES CATEGORIES=ALLVISIBLE MERGE=NO .
But, the significance tests result has errors. One of the error examples: "Total" has 500 cases, and "success" is 249. "Target Category" has 193 cases, "success" is 107, and "CTABLE" tell me: they have significance difference .
By the way, I have another idea, "Merge File With Cases", and forge a category of "Total", a magical thing happened, and there was no significant difference in the results this time.
So, I am very confused about the testing method for "CTABLES". If possible, I hope you can list out the formulas. If necessary, I can also send you my data.
------------------------------
Zhiying Na
------------------------------
Original Message:
Sent: Fri April 05, 2024 12:14 PM
From: Kirill Orlov
Subject: Significance tests vs total in custom tables
There is no such option. Because - tell us - which way to go to (say) "compare a percentage of a yes-response in a group with that in the total sample".
Treating the total's percent as a fixed number and do the one-sample test? But total sample isn't the population, its percent has its error. (And, besides, mind that the same every respondent who effected the group's percent participates one more time to form the total sample percent. This violates the assumption that the large population must be independent from the sample from it in the sense that it is infinitely larger.)
Alternatively, comparing a group with the total would be comparing that group with all the rest groups joint. This way, two groups are compared. It is legal. However, each group is thus gets compared with a nonfixed group, the group percent - compared with "total" percent which changes each time, each comparison.
The third option is to break - in advance - each of your groups (subsamples) randomly into two parts: one (a bigger part) will still represent that group; the other (smaller and proportional to its share in the population) - will be sent to join with the other such parts from the other groups - to form the "group representing the population". So, having k groups initially, you end with k+1 groups and compare the k ones with that quasi-population representative one. You are comparing each group with one fixed group, nice; but, as your groups are of smaller n now, you've lost some power.
Unfortunately, CTABLES does only all pairwise comparisons, and not each-with-one. But you could still request all pairwise without adjustment for multiple comparisons, and then apply the actual adjustment you need yourself.
P.S. I was speaking of comparing proportions - as an example - but the same logic applies to comparing means.
------------------------------
Kirill Orlov
Original Message:
Sent: Fri April 05, 2024 09:07 AM
From: Christine L
Subject: Significance tests vs total in custom tables
Hi team,
we are using significance tests in custom tables.
Next to countries as columns we also include a total column and want to test all other columns not only against each other but also against total.
Can you kindly advise how to do that in syntax?
CTABLES
/VLABELS VARIABLES=Q34 dcountry
DISPLAY=LABEL
/TABLE Q34 [MEAN] BY dcountry
/CATEGORIES VARIABLES=dcountry ORDER=A KEY=VALUE EMPTY=INCLUDE total=yes
/CRITERIA CILEVEL=95
/COMPARETEST TYPE=MEAN ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES
CATEGORIES=ALLVISIBLE MEANSVARIANCE=ALLCATS MERGE=NO SHOWSIG=NO
/TITLES title="Subscription Metrics".
Thanks much for your support.
------------------------------
Christine Loof
------------------------------