For a stats question the data was not normally distributed but the question required a two way ANOVA, a transformation was therefore used and all worked out fine.
The raw data isn't assumed to be normally distributed in two way ANOVA.
(Something is assumed to be normal, but it's not the data. At least, not unconditionally. What did you check for normality, and how?)
What transformation has done is made your comparison no longer a comparison of means.
On the other hand, ANOVA isn't particularly sensitive to mild non-normality, and the larger the samples, the more non-normality it can tolerate.
Now the next part requires the data set to be split by one of the nominal variables (in SPSS) and a t-test to be run.
Obviously the transformed data is normally distributed
You have no basis on which to assert that the transformed variable is normal. It might look normal, but that doesn't mean it is. (On the other hand, you can tolerate approximate normality, so this error isn't of much consequence.)
and therefore a t-test is applicable, however the original data (not normally distributed) could also be applicable using a non-parametric test. Which one would be the best to use and why?
Possibly either, possibly neither. What is the required null and alternative? What assumptions are you prepared to make?
The nonparametric test is not a test of equality of means, for example, unless you add some assumptions (such as a location-shift alternative).
If the variances are close to equal, the t-test is reasonably robust to mild/moderate non-normality. (And if you use the Welch approximation, the t-test deals pretty well with unequal variance)
Aside from those two, and a t-test after a transformation, another possibility is to perform a permutation test.
You really need to give more detail about the specific hypotheses you wish to consider.
As a piece of general advice, either the Welch t-test or the Wilcoxon-Mann-Whitney might be reasonable, but there's presently not enough information to suggest leaning toward one or the other, or indeed something else.
Best Answer
As commented by @Dave and as probably pointed out many times on CV (e.g. here and here), you shouldn't worry about the marginal ("overall") distribution of the response, but the conditional distribution (which you have, by looking at the histogram of the residuals).
Depending on what you're doing, you might not even need to worry about the non-Normality in the residuals/conditional distribution. Linear models (including LMM) are pretty robust to moderate amounts of non-Normality. That said, if you are modeling responses on a 0-1 scale, you might want to worry about issues like nonlinearity, ceiling effects (i.e. what happens when relative recall gets close to a boundary at 1?), and heteroscedasticity, all of which are potentially bigger issues than the mere lack of Normality in the residuals.
If relative recall is measured on a continuous (0,1) scale, and if there are no exact 0/1 values, it probably makes most sense to model it as a Beta distribution. (Also assuming that this is not a ratio with a known denominator, e.g. 5/17, in which case it's probably best to use a binomial model). There are several R packages that can fit mixed-effect beta models (
glmmTMB
,brms
,mgcv
,INLA
,gamlss
).For example, if the number of items offered to each subject in each category (i.e. the number of items making up the denominator of each computed
relativerecall
observation) is stored asN
in the data set, then the model fitwhere
FUN
is eitherlme4::glmer
orglmmTMB::glmmTMB
, should work and should give nearly identical results. Theweights
argument is important ...If you have a significant number of exact-0 or exact-1 values (so many that "squeezing" slightly to get them off the boundary seems dicey) you'll need a zero-inflated or zero-one-inflated Beta mixed model, which limits your choices slightly further.