# Comparing Proportions of Time

If we imagine that someone is interested in whether employees in certain industries sustain workplace injuries disproportionately, and they have data like the following...

Industry # Employees w/ Injuries # Employees
Carpentry 100 1000
Shipping 25 500
Welding 10 250

... then I believe they can use a chi-square proportions test or similar to test whether the proportions implied by the middle column are different from the proportions implied by the rightmost column.

However, if the data of interest are more like the following...

Industry Days of Work Missed Due to Injury Total Days on Payroll
Carpentry 200 300,000
Shipping 75 150,000
Welding 100 75,000

...then a chi-square proportions test seems inappropriate since many of the "days" are accounted for by the same individuals and thus aren't really independent observations.

Is there a sensible test to compare the proportions implied by the middle and rightmost columns of the second table?

Happy to provide any further info that would be helpful, and my apologies if I've overlooked something basic in setting this up.

• 'Round' numbers throughout suggest that these are fictitious data for a homework problem. I will show results for one of the two parts in R and let you show expected counts and computations of chi-squared statistics on your own. // This question needs a self-study tag. Nov 2, 2021 at 19:11
• @BruceET Thanks for writing! Not a homework problem (I'm not a student), but I can't share the actual data, so these are fictitious. Hope that's all right. Nov 2, 2021 at 19:25
• As long as the fictitious rounded numbers are good approximations of the actual counts, results should be similar. Of course the method is the same. Nov 2, 2021 at 19:47

## 1 Answer

I put your counts into a table (please proofread).

Inj = c(100, 25, 10)
Tot = c(1000, 500, 250)
NoI = Tot - Inj

TBL = rbind(Inj,NoI)
TBL
[,1] [,2] [,3]
Inj  100   25   10
NoI  900  475  240


Then you can do a chi-squared test in R. (By default, the Yates correction is used; it make little difference here.)

chisq.test(TBL)

Pearson's Chi-squared test

data:  TBL
X-squared = 17.358, df = 2, p-value = 0.0001702


The null hypothesis (that proportions are homogeneous across industries, is strongly rejected with P-value about 0.0002.

In R, an alternative test of proportions, compares $$\hat p_C = .10, \hat p_S = .05, \hat p - 0.04,$$ finding that there are significant differences among population. In R, this test is equivalent to the chi-squared test. [In various statistical software programs you may find variations of this test--depending on rounding conventions, and on how the standard error of the test statistic is computed.]

prop.test(Inj, Tot)

3-sample test for equality of proportions
without continuity correction

data:  Inj out of Tot
X-squared = 17.358, df = 2, p-value = 0.0001702
alternative hypothesis: two.sided
sample estimates:
prop 1 prop 2 prop 3
0.10   0.05   0.04


Neither test resolves where the significant differences may lie. You would have to do ad hoc tests (using significance levels suggested by Bonferroni's method of guarding against false discovery from repeated analyses of the same data). For example, the chi-squared test to compare Shipping and Welding, goes as follows, finding a significant difference. I will leave it to you to run chisq.test on other sub-matrices of TBL.

chisq.test(TBL[,c(2.3)])$p.val [1] 4.49277e-90  Note: Similarly, I also get highly significant results for data on days missed due to injuries. DaysS = c(200, 75, 100) TotD = c(300000, 150000, 75000) DaysN =TotD - DaysS TAB = rbind(DaysS, TotD) TAB [,1] [,2] [,3] DaysS 2e+02 75 100 TotD 3e+05 150000 75000 chisq.test(TAB)$p.val
[1] 9.429762e-12


This test has to be viewed as a somewhat approximate one because days are not independent in the same way that accidents are: one accident can result in one day out of work or many.

If you want to use 'days off' as a measure of the seriousness of an accident, then you might show the number of days off for each employee accident. In a separate question, you might show such data and get opinions on which tests to use.

Addendum: Another look at this using prop.test'

DaysS = c(200, 75, 100)
TotD  = c(300000, 150000, 75000)
prop.test(DaysS, TotD)

3-sample test for equality
of proportions without
continuity correction

data:  DaysS out of TotD
X-squared = 50.87, df = 2, p-value = 8.991e-12
alternative hypothesis: two.sided
sample estimates:
prop 1       prop 2       prop 3
0.0006666667 0.0005000000 0.0013333333


'Prop 1' of 0.0007 and 'Prop 3' of 0.0013 are different. But they are not binomial proportions of 300,000 or 75,000 independent days. Undoubtedly there are some people who were out for two weeks and some out for 2 days.

If there is some way you feel comfortable saying 0.0007 and 0.0013 are meaningfully comparable, then go ahead. If not, try to make better sense of it. Are Carpenters prone to minor injuries that take half as long to recover from as injuries of Welders. Or are Carpenters injured less often than Welders?

If the daily outage rate of Carpenters can be taken as 0.0007 compared to 0.0015 for Welders, then in ten 1000-day work periods, Carpenters and Welders, may have respective numbers of days out as below, where the Poisson accidents are random within each 1000-day span.

rpois(10, .7)
[1] 0 0 1 0 0 0 0 1 2 1
rpois(10, 1.3)
[1] 0 1 3 0 3 0 0 1 2 2
`

Wondering whether that makes sense or seems right to you.

• Thank you very much for this! I had worried that multiple days coming from each person would pose an independence problem and make the "total days" case require a different test than the "number of people" case. Am I correct in understanding that this isn't actually an issue? Thanks again! Nov 2, 2021 at 20:05
• Just saw your edit -- thank you for the clarification. Maybe my question wasn't framed well enough, but that's really what I'm wondering about. Assuming a case like this one, where lengths of individual injuries / tenures on payroll aren't known, but the group totals are, is there an appropriate way to compare the proportions? Much appreciated! Nov 2, 2021 at 20:12
• Maybe you can etic your Question to show how your would propose summarizing data to show days off because of each individual injury. Nov 2, 2021 at 21:21
• There are lots of tests one could do. But no test is any good unless one has a clear idea what is meant by, say 75 days of work lost out of 150,000. Is that one 'hazard' rating for Shipping? Or does that say something interesting about each of the 150,000 days. Is there a way to relate that to the lives of x nr. of people who work in Shipping? // See Addendum. Nov 2, 2021 at 23:26
• Independence would have to be assumed. Might be a reasonable assumption. See speculation in addendum. Then after some thought maybe post the second part anew with your latest ideas so see what others think of your model. Nov 3, 2021 at 0:17