Proper syntax for fixing "variable is constant" error in CrossTabs


New Member
Hi all,

I am running a simple cross tabulation between two nominal variables and using a third (study site location) as a layer. These are Yes/No/unsure answers. In situations where the answers are all "yes" I am unable to get a Chi-Square or P-value. Instead the output returns an error, "No statistics are computed because [variables] are constants."

I did a search and found similar issues in this forum and on one of the IBM forums regarding a Kappa test. The suggestion was to use Sysmis to code the remaining variables. I tried this [Sysmis(variable)] but got very strange numbers, still no Chi Square or P-value, and, of course, the totals were off.

I have an email in to one of the professors at my university, but also wanted to post the question here in the meantime.

How can I rectify this issue? Why would I have to use system missing to code the other answers? I am convinced I did not use the proper syntax as I am used to running simple tests and am using school software and don't have an SPSS book. Further, it seems I may have to split the data set to run the crosstab analysis per site rather than as one major analysis with site delineations (layer 1). Is that a correct assumption?

Thank you for taking the time to read this post. I look forward to learning more!


TS Contributor
If one of two variables is a constant then there is no variation
and it makes no sense to compute measures of association.


New Member
Thank you very much for the response. I will review the literature further to try to understand this concept better. Right now, I still don't really understand why if all respondents answer yes to a particular question, it can't be associated with answers to another question.
To put Karabiner's response another way, if the answers are all yes then there is 100% association with each of the yes, no and unsure responses to the other question.

If on the other hand you suspect that the real answer is something like 95% to 99% association with one of the other responses, then you need to review your method of sampling and the size of sample. If resampling is not an option, then just be honest and report all the results you did get.