I have data in the following format (which I'll call "binomial"):
agency drugrelated appeals petitions
A 0 10 50
A 1 30 80
B 0 20 100
B 1 20 30
C 0 30 70
C 1 40 60
where "agency" is a some governmental agency, "petitions" is the number of freedom of information requests made to the agency, "appeals" is the number of responses to those requests that were appealed by petitioner, and "drugrelated" is whether or not the FOI request involved drug policy.
Combining all agencies would give this 2 x 2 contingency table (represented in database form):
drugrelated appeals F
0 0 160
0 1 60
1 0 80
1 1 90
This should be easy, but how do I get from binomial to contingency table format? With "collapse," "contract," or some other command?
I'd greatly appreciate any help.
Thanks,
David
agency drugrelated appeals petitions
A 0 10 50
A 1 30 80
B 0 20 100
B 1 20 30
C 0 30 70
C 1 40 60
where "agency" is a some governmental agency, "petitions" is the number of freedom of information requests made to the agency, "appeals" is the number of responses to those requests that were appealed by petitioner, and "drugrelated" is whether or not the FOI request involved drug policy.
Combining all agencies would give this 2 x 2 contingency table (represented in database form):
drugrelated appeals F
0 0 160
0 1 60
1 0 80
1 1 90
This should be easy, but how do I get from binomial to contingency table format? With "collapse," "contract," or some other command?
I'd greatly appreciate any help.
Thanks,
David
Comment