Displaying 1 result from an estimated 1 matches for "sp1_0".
Did you mean:
sp10
2007 Nov 20
1
Problem with code for bootstrapping chi square test with count data
...s x with 20 individuals and a factor containing 0 and 1's
(in this case 5 zeros and 15 ones). I want to compare the frequency of
the occurrence of 1 with a probability value. This code seems to work to
do this in R.
attach(test)
p <- c(0.5272, (1-0.5272))
sp1_1 <- length(subset(x, x==1))
sp1_0 <- length(subset(x, x==0))
obs1_1 <- c(sp1_1, sp1_0)
chisq.test(obs1_1, p=p)
However, I'd like to bootstrap these 20 individuals to produce a whole
population of samples and I'd like to do a chi-square test for each of
the bootstrap sample to create a distribution of the chi-square
s...