I have a dataset from some health institues. The data contains information about malaria cases on a 52 week range. The dataset has 52 columns, one for each week and about 16 rows one for each hospital reporting the number of cases in the particular week diagnosed in that hospital. Example of the dataset with 9 weeks entries :-
SAD Lakhwar 0 0 0 0 0 1 4 3 1
Rural Health Center 2 0 0 6 0 2 0 2 2
Herbertpur Christian Hospital 1 0 1 0 2 0 1 0 1
I have used Hierarchical and K-Means clustering for both determining clusters of hospitals as well as clusters of weeks but my real goal is to cluster in such a manner that outbreaks can be detected using data from consecutive weeks and at the same time the cluster of hospitals in which the outbreak is noticed is also found out.
The techniques I have used till now find me clusters where in some cases weeks are away from each other, for example the 7th and 37th week fall into the same cluster as can be seen in the output given below but I want to achieve continuity in weeks because outbreaks span over a few weeks I understand the reason of the results I am getting but I want continuity, if anyone could help.
The result of trying to cluster the weeks into 4 clusters using k means
Week No x
1 2
2 4
3 4
4 2
5 4
6 2
7 1
8 2
9 2
10 2
11 2
12 4
13 1
14 4
15 4
16 4
17 1
18 4
19 1
20 4
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
30 1
31 1
32 3
33 1
34 1
35 1
36 1
37 1
38 3
39 3
40 3
41 3
42 3
43 3
44 3
45 3
46 3
47 3
48 3
49 3
50 1
51 4
52 4
Dput of the data
structure(list(V1 = structure(c(13L, 15L, 6L, 10L, 3L, 17L, 12L,
1L, 2L, 11L, 4L, 14L, 8L, 9L, 7L, 5L), .Label = c("CHC Sahaspur",
"Comb. Hosp. Premnagar", "Doon Hospital", "FRI Hospital", "Herbertpur Christian Hospital",
"HIHT Jollygrant", "Kalindi Hospital", "MAX Hospital", "PHC Herbatpur ",
"PHC Kalsi", "PHC Rajawala", "Rural Health Center", "SAD Lakhwar",
"Shubharti Hospital", "SPS Rishikesh", "Total", "Vaish Nursing Home"
), class = "factor"), V2 = c(0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0), V3 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
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),
V42 = c(0, 0, 1, 0, 8, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0),
V43 = c(0, 1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V44 = c(1, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V45 = c(0, 0, 9, 0, 6, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1),
V46 = c(0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V47 = c(0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V48 = c(0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0),
V49 = c(0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V50 = c(0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V51 = c(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V52 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
V53 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), .Names = c("V1",
"V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9", "V10", "V11",
"V12", "V13", "V14", "V15", "V16", "V17", "V18", "V19", "V20",
"V21", "V22", "V23", "V24", "V25", "V26", "V27", "V28", "V29",
"V30", "V31", "V32", "V33", "V34", "V35", "V36", "V37", "V38",
"V39", "V40", "V41", "V42", "V43", "V44", "V45", "V46", "V47",
"V48", "V49", "V50", "V51", "V52", "V53"), row.names = c(NA,
16L), class = "data.frame")