Apart from graphical estimation of linearity (gaze-at-scatterplot method), which is utilized before applying some technique from GLM family, there are several ways to do this estimation arithmetically (i.e. without graphs).
Right now, I'll focus on Fisher's eta-squared - correlation ratio: arithmetically, it's equal to squared Pearson's r (coef. of determination: r2) if relationship between two variables is linear. Hence, you can compare values of eta and r and make an assessment about type of relation (linear or not). It provides an information about percent of variance in the dependent variable explained (linearly or not) by the independent variable. Therefore, you can apply it when linearity assumptions are not met.
Simply stated: is there a routine for eta/eta-squared in R?
I'm still quite stunned, I must admit... there's no easy and straightforward way for calculating η or η2 in
R
... So I wrote a function according to Wikipedia page. Here goes:So this yields another question, which I'm about to post shortly... what do you use to check linearity? However, I can't calculate p-values, so if anyone knows how to do it... please, let me know!
After reading this Question, and trying the function in the answer, I just found this the library "sjstats". There is an Eta-Squared-function included. Maybe it is helpful for future seekers.