SPSS help please please

This forum made possible through the generous support of SDN members, donors, and sponsors. Thank you.

degoo_

Full Member
10+ Year Member
15+ Year Member
Joined
Oct 15, 2006
Messages
331
Reaction score
1
Hey,

I am clueless with SPSS and have been sent some data that I need to sort out.
I have a file with a column of IDs (both patients and controls). Another column has their genotypes numerically coded to make stats easier. I need to do a Chi-squared test to see whether the genotypes differ between the patients and controls.
I have an output file from some old data, so I know what the output is supposed to look like, but whenever I do a crosstab with Chi-Square option checked, I get a really weird table that's not doing what I want. I think part of the problem is that patients and controls are in the same column.
Any help greatly appreciated. thanks ppls.

Members don't see this ad.
 
You need to recode the ID column to separate out the patients and controls (NOT into separate variables though) ... just create a modified ID variable that has controls coded as "1" and patients coded as "2" for example - then do the crosstabs w/ a Chi-square against your genotype variable.
 
Thanks so much. That sounds right. How does one create a modified ID though? I am not familiar with SPSS at all.
 
Members don't see this ad :)
I don't know what your data looks like exactly, but let me conjecture and maybe that can help you. Assume your current variables are named "ID" and "genotype".
Let's say all your control IDs are from #s 1 to 99, and your patient IDs are #s 100 to 199. Your syntax should look something like this then:

compute IDnew=9.
if (ID le 99) IDnew=1.
if (ID ge 100) IDnew=2.
var lab IDnew 'ID recoded - control vs. patient'.
val lab IDnew 1 'control' 2 'patient'.
fre IDnew.
cro IDnew by genotype/cells=count row col/sta=chisq.

Hope that is helpful - people can abbreviate SPSS syntax differently - so I hope that makes sense to you - it should work. I'm not the biggest SPSS expert, but I have used it alot.
 
I PMed you. Thanks for helping me out
 
Top