created function for inferential statistics