# (Basic) statistics

I got a misunderstanding regarding basic statistics (I think) but I can't get my head around that: I did an online survey regarding the usage of some application. The user could answer 1 (I don't know that application), 2 (I know that) or 3 (I use that). Now I want to know, how many applications the average user uses:

df['iuse'].mean()


where df['iuse'] was calculated as the count of answer 3 in one returned answer. The result is something like 2.2.

Now, I want to know, how many applications a user of application X uses:

f = df['q1_1'] == 3 # For application 1, filter all answers where the user uses that
df.loc[f,'iuse'].mean()


That returns a number above 2.2 - for every single app: In short (and ugly):

[(4.235294117647059, 85),
(4.966666666666667, 60),
(2.7495274102079397, 1058),
(4.609195402298851, 87),
(6.391304347826087, 23),
(4.122950819672131, 122),
(4.850746268656716, 67),
(3.1860068259385668, 586),
(2.72192513368984, 1122),
(3.520231213872832, 346),
(4.276595744680851, 94)]


(left is the mean, and right is the count of answers for that application)

Now: Why is the usage overall less than the usage when seen from a specific application? I would expect to have at least some numbers below the total mean, but they are all above that. I'm confused :(

Thanks for any pointers and help Klaus

• First: The answer in iuse is encoded (by you) as a number, but it is a so called categorical value. That means that you cannot apply just any operator on it: Not equal works, but a mean definitely does not. For the connoisseur: It seems ordinal, so you could rank it. Second: Could you include a sample of your dataframe? Mar 3, 2020 at 13:00
• OP: it would be clearer if you provided a sample frame. @SvanBalen, it sounds like the 'iuse' column has been generated. Each row is a user/response, with columns for each answer, like 'q1_1', and those are encoded 1/2/3; but 'iuse' then is just a row-wise count of qi_j==3. Mar 3, 2020 at 14:42
• Thanks guys, I'll make sure to include a better example next time, but for now @BenReiniger has given a good explanation Mar 3, 2020 at 16:50
• @BenReiniger Yes it could be a derived feature. Nevertheless it remains a categorial value, and taking the mean is... wait for it ... meaningless Mar 4, 2020 at 13:18
• @SvanBalen 'iuse' is a count variable; discrete, but numerical, not categorical. The mean of that is perfectly sensible. I'd agree about the mean of any of the qi_j's... Mar 4, 2020 at 13:26

Then the average apps used by a user is $$(90\cdot0+10\cdot11)/100=1.1$$, but for each app, the average app-usage of a user who uses that app is $$(10\cdot11)/10=11$$. (In your case, for a sanity check maybe compute the number of users who use no apps.)