# Non-normal data transformation - what does it imply exactly and what does my results mean?

I am missing some understanding here. I am inspecting the relationship between the heart rate variability (HRV) and errors in the Sustained Attention to Response Task. When I conduct a basic linear regression with R with the original values I get close to a significant result. When I inspect my qq-plot I realise that the residuals are not normally distributed (picture 1). Then I decided to do a square root transformation to the HRV data and I find the residuals a bit more normal (picture2). Also, I find a significant result. Here I run into a dilemma. Can I justify transformation if the residuals looks a bit "better" and say I have a significant result, which I do not have with the non-transformed data. This feels a bit wrong. Is it? And what does my results mean now when transformed HRV has a significant association with the performance in this test? The HRV is, of course, a somewhat arbitrary number and the participants still stay comparable in that matter even though I do the transformation, but somehow the relationship is changed. And did the transformation made residuals normal enough that I can do linear regression? Cheers!

• Linear regression is always a good, first benchmark against which to compare more complex models. In this case, it's apparent that neither model is doing a particularly good job fitting the data. Try adding polynomials of the predictors or fitting nonlinear regressions. Lots of posts on CV about these methods. – Mike Hunter Nov 14 '20 at 15:25
• Heart rate variability can't be negative and zero values are implausible. For such an outcome a Poisson regression is often a good first approximation Whether the outcome is a count or count-like variable is immaterial: see e.g. blog.stata.com/2011/08/22/… – Nick Cox Nov 15 '20 at 11:32

For the first task, one of the best approaches with a continuous predictor is to model it as a restricted cubic spline rather than as a single polynomial. You choose a small number of knots. The regression itself then fits a smooth curve through those knots, and standard methods can determine whether adding additional knots significantly improves the fit. Thus you don't have to guess the correct form to start, and you have a principled way to choose the flexibility of the fit. This regression approach is provided, for example, by the rcs() function in the R rms package.