# What test of significance should I use to analyse visits to a clinic by various groups?

Apologies for the noob question. After a day on Google and Wikipedia I still can't quite work out what to do. So here I am.

A small private healthcare clinic in the UK has asked me to look at their patient appointments data. Patients hear about the clinic from various sources (Google, word-of-mouth, leaflets, etc etc). Plotting [patient numbers] against [number of appointments per patient] appears to reveal intriguing patterns in patient "loyalty":

The X-axis is each source:

• saw the clinic while visiting another business in the same building
• recommended by another patient
• friend of the clinician
• etc
• saw our street sign
• etc
• etc etc etc

The pink bars show total number of patients per source. Not too surprising that Google is up high, as is the street sign. But intriguingly the patients from Google/street-sign only come for 3 or 4 appointments - see the blue bars - whereas the patients to the left from sources including word-of-mouth appear to be more "loyal", visiting for a higher mean number of appointments.

I'm curious if this is a real effect, or a glitch in the smaller sample sizes of the left-most data. The left-most 4 sources have sample sizes of 7, 12, 6 and 9.

Exactly which test should I use to determine significance here? I have month-by-month totals for each source for the past year, like this:

As you can see, I've started calculating standard deviations and standard errors. However I'm a little stuck now. Should I be using ANOVA here? If so, how exactly?

I should add I'm a novice at this so feel free to use small words and type slowly. I've looked through "similar questions" but I'm still no wiser.

Since you are collapsing monthly visit values into annual mean and s.d. for each source, ANOVA would be appropriate if you wanted to test for the equality of means across the sources. You have to check, however, that the variances are equal across the groups (sources) -- and I can see that that the s.d. are not equal. Therefore, you should use Welch ANOVA or Kruskal-Wallis.

It would probably be better to also obtain the individual customer data, since there will likely be customer-specific covariates (other explanatory variables) such as medical diagnosis, severity of disease, socioeconomic status, level of education, which predict number of return visits. (patients with serious or worse conditions typically have more visits). In this case, if you could also get the total billing cost for each patient, it may be more informative to model total cost, rather than visits. (originally, you presented a chart of total visits and return visits by source, but you don't need to make the chart to think about data analysis -- the chart merely reflects results based on a specific method of collapsing the data. When you collapse data, you can lose information).

There actually are many types of analyses you could do with your data, so approach the analysis by first writing down your beliefs (alternative hypotheses), and then determine which test statistic is required to discredit the null hypothesis for the associated alternative hypothesis.

Example: I believe that sales from next quarter will increase by 10% if the advertising department increases this quarter's advertising budget by \$10m. Test: use a t-test or Mann-Whitney test to determine if mean sales (from all stores in the company) are significantly different between this quarter and next quarter. If the tests are significant, then your belief was true, otherwise, untrue.

@ukosteopath: Yes, the KW would give a single p-value, and the test statistic is based on chi-square with k-1 groups (sources). To run KW, open Excel and copy all the monthly visit numbers into a single column using rows 1-12, then add source 2 monthly values to rows 13-24 in the same column. Add all the monthly visit data for each source to their respective 12 rows. Then in a second column, enter the rank (ascending order based) associated with each row, and make sure you rank over all the rows. Use the average of ranks for any tied values. Add a third column and set the first 12 row values to group 1, set row values 13-24 to a value of 2 (this represents the source) and so on for the number of sources you have. You can now actually run KW on the ranks (and actually can run ANOVA on the ranks as well) where the source number (column) serves as the group or "factor" variable. For group pairwise tests, use the Mann-Whitney test (Wilcoxon rank sum test) -- and these are actually not the same test but many software vendors loosely call them the same tests.

• I gather K-W tests the null hypothesis "the probability a random observation from a group is larger than another from another group is 0.5" The K-W test would give a single result for my entire data, rather than for specific groups (sources)..? Can I use the K-W test to test a group-specific hypothesis e.g. "Source1 patients return more frequently than source5 patients"? Or should I conduct multiple t-tests of various pairs of sources (bad idea?) As for your comments re raw data and other tests, I fully agree. Unfortunately I only have the data presented here - other data is not collected. Jan 10, 2014 at 16:47
• see updated response above.
– user32398
Jan 10, 2014 at 22:23