t-test

Perform multiple paired t-tests based on groups/categories

ε祈祈猫儿з 提交于 2019-11-27 21:32:57
问题 I am stuck at performing t.tests for multiple categories in Rstudio. I want to have the results of the t.test of each product type, comparing the online and offline prices. I have over 800 product types so that's why don't want to do it manually for each product group. I have a dataframe (more than 2 million rows) named data that looks like: > Product_type Price_Online Price_Offline 1 A 48 37 2 B 29 22 3 B 32 40 4 A 38 36 5 C 32 27 6 C 31 35 7 C 28 24 8 A 47 42 9 C 40 36 Ideally I want R to