# how to statistically test two sums of 1s [closed]

I have the following vectors:

vec_1=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
vec_2=c(1,1,1,1,1,1,1,1,1)


from which I compute the corresponding sums:

> print(sum(vec_1))
[1] 18
> print(sum(vec_2))
[1] 9


Is there a way to test if these two sums are statistically different?

• Well... clearly they are different since they are of different sizes, since if they were of same size the sum would be identical because you only have 1's in your data. Right now you are asking something like if the number of occurrences is statistically different between these two vectors, is this what you want? Give us some context on the actual problem. Commented Jan 29 at 10:53
• Detail: Don't be misled by the function name used in R. The test you're referring was proposed by Wilcoxon. Commented Jan 29 at 11:34
• Please tell us more about the data generating process. Why are the number of ones different? Is the number of observations in both groups identical and sometimes you observe an event and sometimes you don't? Commented Jan 29 at 11:58
• yes. Assuming that we have two time-series of days from 1 to 100, I observe the 1s in specific days within the whole time-series and the 1 observations change between the two time-series (here represented as vectors) Commented Jan 29 at 12:03
• So, you really have 18 ones and 82 zeros in one series, and 9 ones and 91 zeros in the other series. With that, you can test whether the proportion of ones is different between the two, e.g., in R prop.test(c(18,9),rep(100,2)). Is this what you are looking for? Commented Jan 29 at 12:36