How would I calculate the shape of the average (using the median) of a variable from a group within a data set? I need a certain function for calculating the centre of gravity (centroid) or Euclidian centre of this group of variable.Many thanks!!