Significance of a two-sample-test Can anybody explain me how to determine whether the number of infections of kids has increased from 1999 to 2009 and evaluate its statistical significance?  Here are some sample data:
                       Woman   Man   Kids  | (total number of examined people)
test group 1 (1999)     25      5      9   |  100
test group 2 (2009)     21      8     10   |  100

 A: If you want to test if the number of children who are infected has changed significantly against the entire population, you can perform a prop.test() in R. This will provide you a 2-sample test for equality of proportions. It really depends on what you are testing against, though. Do you only want to test across the population or just the infected population? You can also change the alternative in prop.test to accommodate a more limited hypothesis (i.e. if you want to test only if there was an increase and not a two-sided test which is what I performed).
a = array(data=c(25,21, 5, 8, 9, 10,61,61), dim=c(2,4), dimnames=list(c("1999", "2009"), c("Women", "Men", "Children", "Not Infected")))
addmargins(a)

prop.table(a, m=1) #m=2, calculates the table along the column margin

In this case, the null hypothesis is that the two rows are equal.
More specifically, the two years have no significant difference in proportion of the entire population. If you want to change this to just the infected population or infected children, you can do that too. 
# test just the infected children against the entire population (infected and not)
result = prop.test(a[,3], n=c(100,100), correct=FALSE) 

# access the results
names(result)
result$p.value

No real surprise that it isn't significant as there is only one more child who is infected in 2009 than in 1999. 
This works, but only once you have figured out what the denominator of your proportion should be. Is it 9/100, 9/39, 9/19? That is your choice once you get into problems that aren't so obvious. A slightly more advanced version of this is chisq.test().
