Open the app

TRTT › Guides › How to Run a Chi-Square Test (Crosstabs) Without SPSS

How to Run a Chi-Square Test (Crosstabs) Without SPSS

You can run a Pearson chi-square test of independence without SPSS using a free tool that follows the same menu path: Analyze ▸ Descriptive Statistics ▸ Crosstabs, then tick Chi-square under Statistics. This guide does it in TRTT, a free SPSS-style app that runs in your browser, on a sample survey file, and explains every table in the output.

The steps match SPSS's own Crosstabs dialog, so if you later sit at a lab computer with SPSS, they'll work there too.

When to use chi-square

The chi-square test of independence asks whether two categorical variables are related. Typical questions:

Use it when both variables are categories (nominal or ordinal), each case counts once, and the categories don't overlap. It is not the right test for comparing means (use a t test or ANOVA, see t tests without SPSS), or for the same people measured twice (that calls for McNemar's test, which TRTT doesn't offer yet).

Data you need

The example uses TRTT's built-in sample, demo_omnibus.sav (400 cases): gender (S1. Gender of respondent) by q7 (Q1_7. "I am willing to pay more for better quality", a five-point agreement scale). The analysis is unweighted.

Step by step

  1. Open trtt.app on a desktop browser and click Sample Dataset on the welcome screen (or open your own file with File ▸ Open Data…).
  2. Choose Analyze ▸ Descriptive Statistics ▸ Crosstabs….
  3. In the variable list, click S1. Gender of respondent [gender] and click the ▶ arrow next to Row(s):. (Double-clicking a variable also moves it.)
  4. Click Q1_7… [q7] and move it to Column(s):.
  5. Click Statistics…, tick Chi-square, and under Nominal tick Phi and Cramer's V. Click Continue.
  6. Click Cells…. Under Counts, keep Observed and tick Expected. Under Percentages, tick Row. Under Residuals, tick Adjusted standardized. Click Continue.
  7. Click OK. The Output window shows the results. (Click Paste instead of OK if you want the syntax for your records.)

Row or column percentages? Put the group you're comparing in the rows and ask for Row percentages, so each row adds up to 100%. Here that reads as "of men, x% … of women, y% …".

Reading the output

TRTT prints four tables.

Case Processing Summary. 389 valid cases, 11 missing (2.75%). The missing ones answered "Don't know" or "Refused" to q7.

The crosstabulation (gender × q7). Row percentages and adjusted residuals for the two end categories:

Strongly disagree Disagree Neither Agree Strongly agree Total
Male, count 9 51 69 43 22 194
Male, % within gender 4.6% 26.3% 35.6% 22.2% 11.3% 100%
Female, count 24 42 54 52 23 195
Female, % within gender 12.3% 21.5% 27.7% 26.7% 11.8% 100%
Adjusted residual (women) 2.7 −1.1 −1.7 1.0 0.1

Chi-Square Tests.

Value df Asymptotic Significance (2-sided)
Pearson Chi-Square 10.391 4 .034
Likelihood Ratio 10.655 4 .031
Linear-by-Linear Association 0.203 1 .652
N of Valid Cases 389

Read the Pearson Chi-Square row: χ² = 10.39 with 4 degrees of freedom, p = .034. Below the conventional .05 threshold, so the answer distribution differs between men and women. The Linear-by-Linear Association row (p = .652) tests for a straight-line trend across the ordered categories, and there isn't one: women aren't simply more or less agreeable overall.

Symmetric Measures. Cramér's V = .163. V runs from 0 (no association) to 1, so this is a weak association, which is common with survey data and a large sample.

Where the difference is. The chi-square test only says the table isn't uniform. The adjusted residuals show which cells drive it: values beyond about ±2 stand out. Here it's "Strongly disagree": 12.3% of women versus 4.6% of men (adjusted residual 2.7). The other categories are close.

Expected counts and assumptions

The chi-square approximation needs enough data in each cell. The usual rule: no more than 20% of cells with an expected count below 5, and none below 1. TRTT checks this for you in the footnote under Chi-Square Tests:

0 cells (0.0%) have expected count less than 5. The minimum expected count is 16.46.

So the example is fine. If your table fails the rule, merge sparse categories (for example, "Strongly disagree" with "Disagree") with Transform ▸ Recode into Different Variables… and rerun.

One difference from SPSS to know about: for 2×2 tables, SPSS also prints a continuity correction and Fisher's exact test. TRTT currently prints Pearson, likelihood ratio and linear-by-linear rows only, so for a small 2×2 table that needs Fisher's exact test, use another tool. McNemar and Cochran's/Mantel-Haenszel statistics are greyed out in the Statistics dialog as not yet available.

The syntax version

The same analysis as syntax, to paste into Window ▸ Syntax and run:

CROSSTABS
  /TABLES=gender BY q7
  /CELLS=COUNT EXPECTED ROW ASRESID
  /STATISTICS=CHISQ PHI.

The Paste panel below the editor also shows equivalent R and Python code for the dialog you used. Supported commands are listed in Run SPSS syntax in your browser.

Reporting in APA style

A typical write-up:

A chi-square test of independence showed a significant association between gender and willingness to pay more for quality, χ²(4, N = 389) = 10.39, p = .034, Cramér's V = .16. Women were more likely than men to strongly disagree (12.3% vs. 4.6%).

Notes: report df and N in the parentheses, give p to three decimals (p < .001 when it is smaller), and add an effect size: Cramér's V, or phi for a 2×2 table. Report the crosstab with row percentages in a table if the pattern matters to your argument.

Open TRTT in your browser – free

Related: SPSS alternative online · t tests without SPSS · Cronbach's alpha without SPSS

FAQ

Can I run a chi-square test online for free?

Yes. TRTT runs Crosstabs with Pearson chi-square in your browser, free, on a real .sav file, with the computation done on your own computer. Simple chi-square calculators also work if you already have the counts.

Is this the same as SPSS's chi-square output?

The menu path, dialog options and table layout follow SPSS. TRTT is tested against PSPP and published SPSS algorithms, so the Pearson value, df and p match the standard formulas; it is an independent program, not SPSS. For 2×2 tables, TRTT doesn't print Fisher's exact test or the continuity correction.

What if the chi-square test isn't significant?

Report it the same way with the exact p-value, for example χ²(1, N = 400) = 0.72, p = .395 for gender by "bought the brand" in the same sample. A non-significant result means the data give no evidence of association, not proof that there is none.

Which percentages should I report?

Percentages within the group you're comparing. If gender is in the rows, report row percentages ("x% of women").

Can I do this on an iPad?

Yes. The TRTT iOS app has the same Analyze ▸ Descriptive Statistics ▸ Crosstabs path. The free version handles datasets of up to 100 cases; the built-in sample opens in full. See SPSS for iPad.


TRTT is an independent product. It is not affiliated with or endorsed by IBM. IBM and SPSS are trademarks of International Business Machines Corporation.

More in Guides