My dataset contains information such as feedbackDate
and Subcategory(issue) and location (6 months data). The temporal calculation was by cross tabulating the subcategory of issues with their feebackDate
s and then calculating Pearson correlation score for every pair of cross tabulated issues. See the code below
#weekly correlation
require(ISOweek)
datacfs_date$FeedbackWeek <- ISOweek(datacfs_date$FeedbackDate)
raw_timecor_matrix <- table(datacfs_date$SubCategory, datacfs_date$FeedbackWeek)
raw_timecor_matrix <- t(raw_timecor_matrix)
timecor_matrix <- cor(raw_timecor_matrix)
#Invert correlation to get distance matrix
inverse_tcc <- 1-timecor_matrix
Now the question is how do I calculate this on biweekly and monthly basis instead of weekly correlation of six months data.