Code:
. tab myrep2 foreign, exp chi2 lr +--------------------+ | Key | |--------------------| | frequency | | expected frequency | +--------------------+ RECODE of | Car type myrep | Domestic Foreign | Total -----------+----------------------+---------- 13 | 37 3 | 40 | 27.8 12.2 | 40.0 -----------+----------------------+---------- 45 | 11 18 | 29 | 20.2 8.8 | 29.0 -----------+----------------------+---------- Total | 48 21 | 69 | 48.0 21.0 | 69.0 Pearson chi2(1) = 23.6449 Pr = 0.000 likelihood-ratio chi2(1) = 24.9946 Pr = 0.000