# Statistical tests when each variable in a sample is a percentage

I am performing a temperature preference test in mice. Mice are placed into a chamber with one half of a chamber having a cold floor and the other half having a warm floor. Mice spend a specific total time in the chamber (3 min) and can select the cold or warm part of the chamber. I calculate the time (in percent of the total time) spent on each side for each subject (each mouse). The results look like this:

Mouse   Warm%   Cold%
1     85%     15%
2     80%     20%
3     87%     13%
4     84%     16%

1. How do I calculate the confidence interval for the mean cold time percentage of the population from which this group of mice was selected?

2. If I perform the same test with a second group of mice which received some experimental treatment, which statistical test to use to check for a difference between two groups of mice?

It depends a bit on how you calculated those percentages, but I will guess at some simple method. If your 85%, for example, means "looked at the mouse 20 times; 17 times it was in the warm" then it's the mean of a binomial (Bernoulli) variable with possible values 0 and 1. Score 0 = cold, 1 = warm, mean 0.85 or 85%.

Note that there is really one percentage being estimated here, as the two sum to 100 by definition.

However, there is a big reservation. Those so-many observations may not be independent. Suppose a mouse prefers warm, so it chooses warm, but then it gets too hot and moves to the cooler bit; or vice versa. You can only treat them as independent if you are confident that your set-up is equivalent to the same number of experiments in which each mouse was observed once and heating and cooling effects don't operate.

For more complicated set-ups, you would probably be best off recasting this as a logit model. That wouldn't solve any dependence problems unless you build those into the model.

• Your percentages are thus closer to measured percentages, rather than being based on counting. Some people might want to transform them using logit or angular scale. You could try using standard normal-based methods to compare groups of mice, e.g. anova. – Nick Cox May 22 '13 at 17:27
• @Viktor Why is that information not in your question? I'd suggest beta regression as a possibility. – Glen_b May 23 '13 at 8:37
• +1. Beta regression could be better. It respects the bounded response, between 0 and 100%, which anova ignores. You might not find an implementation in all environments. I am familar with betafit for Stata. There is also an excellent implementation in R. – Nick Cox May 23 '13 at 9:16
• @Glen_b My mistake. I didn't realize it matters. I thought percents are percents no matter how you derived them. Now I kind of understand that they can represent a discrete variable or a continuous variable depending on how you calculated them. – Viktor May 23 '13 at 17:58
• The impact will depend on how close the means are to the boundaries. There is no difference here between raw data and fraction, as all you are doing is dividing by a constant. – Nick Cox May 23 '13 at 18:16