created subroutines for analyses within MetaResponseAnal.m