Login  Register

Re: Show an empty category in a frequency table

Posted by Bruce Weaver on Apr 22, 2015; 1:25pm
URL: http://spssx-discussion.165.s1.nabble.com/Show-an-empty-category-in-a-frequency-table-tp5729310p5729322.html

Good catch, Andy.  I was just about to post the "exact" test results when I saw your post.  For those who do not currently have access to SPSS, here are the results for both Chi-square and exact tests (with p-values rounded to 6 decimals):

Test Statistics
Q1
Chi-Square 17.600[a]
df                 5
Asymp. Sig. .003492
Exact Sig.        .003439
Point Probability .001667
[a] 6 cells (100.0%) have expected frequencies less than 5. The minimum expected cell frequency is 1.7.


Syntax:

DATA LIST free / Q1 (F1).
BEGIN DATA
1 1 1 1 1 1
2
4 4 4
END DATA.

NPAR TESTS
  /CHISQUARE=Q1 (1,6)
  /EXPECTED=EQUAL
  /METHOD=EXACT TIMER(5).



Andy W wrote
Never mind the comment about the small counts. I evaluated the test using the exact distribution and it results in the same inferences. See http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2476536 for a more detailed description of the procedure.

I made some R code to create the exact distribution for this case. One thing to note is that using the exact distribution will only make the p-value smaller, so if you reject the null using the asymptotic distribution you will also reject using the exact distribution, which is what happens in this case.

####################################
library(partitions)
loc <- "C:\\Users\\andrew.wheeler\\Dropbox\\Public\\" #just replace where you download the file
f <- paste0(loc,"Exact_Dist.R")  #file available at "https://dl.dropboxusercontent.com/u/3385251/Exact_Dist.R"
source(f)

#my small sample test function that returns the exact null distribution
d <- c(6,1,0,3,0,0)
res <- SmallSampTest(d=d,type="Chi")
res[2:5]

#gives the same inferences
chisq.test(d)
chisq.test(d,simulate.p.value = TRUE, B = 1e4)
####################################
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).