creating 2x2 table

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

creating 2x2 table

Martin P. Holt-2
Say you have a table:

        +        -
+    150      15
 -      39      113

and you want to do crosstabs on it.

Is there a way of reading this table in direct, without having all the raw
data ?

I hope I'm clear enough. Thanks in advance,

Martin
Reply | Threaded
Open this post in threaded view
|

AW: creating 2x2 table

la volta statistics
Hi Martin

Try the following syntax:

DATA LIST LIST /Var1(f8.0) Var2(f8.0) Weight(f8.0) .
BEGIN DATA
1 1 150
1 2 15
2 1 39
2 2 113
END DATA.

Val Label Var1 Var2 1 '+'
                     2 '-'.

WEIGHT
   BY Weight .


CROSSTABS
 /TABLES=Var1 BY Var2
 /FORMAT= AVALUE TABLES
  /STATISTIC=CHISQ
 /CELLS= COUNT .

Hope this helps
Christian

-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von
Martin P. Holt
Gesendet: Mittwoch, 11. Oktober 2006 14:38
An: [hidden email]
Betreff: creating 2x2 table


Say you have a table:

        +        -
+    150      15
 -      39      113

and you want to do crosstabs on it.

Is there a way of reading this table in direct, without having all the raw
data ?

I hope I'm clear enough. Thanks in advance,

Martin