0

I have this database:

             comp       cf promedio.corr
1       quercetina 0.009280    162440.500
2       quercetina 0.013920    295162.250
3       quercetina 0.018560    397905.250
4       quercetina 0.023200    507763.844
5       quercetina 0.027840    606743.750
6       quercetina 0.032480    731080.000
7       kaempferol 0.008960    228351.417
8       kaempferol 0.013440    346236.417
9       kaempferol 0.017920    472974.167
10      kaempferol 0.022400    584887.833
11      kaempferol 0.026880    678555.917
12      kaempferol 0.031360    819857.917
13        vanilico 0.001304     28488.083
14        vanilico 0.001956     40749.833
15        vanilico 0.002608     55826.333
16        vanilico 0.003260     69278.292
17        vanilico 0.003912     80731.083
18        vanilico 0.004564     95018.083

I'm trying to execute different linear model test depending on "comp" column (for example, I would like to obtain Y intercept and correlation coefficient based on the column "comp"). I have tried sapply function but I may be wrong because I do not get anything. My question is how can I execute different functions depending on the first column? Thank you very much for your valuable support Have a great day!

  • 1
    You mean [this](https://stackoverflow.com/questions/1169539/linear-regression-and-group-by-in-r)? – Sotos Nov 19 '18 at 15:44
  • Oh, I see. That is a good answer. Thank you very much. But when I want to perform a normality test, homoscedasticity test or even an ANOVA, can I use the same function? – Carlos Medina Saldivar Nov 19 '18 at 16:02

0 Answers0