Regression Modelling of Linear, Exponential, and Power Curves in R Please note this is cross-posted: https://stackoverflow.com/questions/57982488/regression-modelling-of-linear-exponential-and-power-curves-in-r
I am trying to model reaction time (and other) data across trials (trial 1-5) using different mathematical functions. Specifically I model linear, exponential, and power functions using linear mixed effect models by transforming data and use AIC/BIC to compare fits:
Linear: lmer(ReactionTime ~ Trial + (Trial | Subjects), data = lmerdata)

Exponential: lmer(log(ReactionTime) ~ Trial + (Trial | Subjects), data = lmerdata)

Power: lmer(log(ReactionTime) ~ log(Trial) + (Trial | Subjects), data = lmerdata)

By doing this, the exponential and power equations imply a different distribution for errors than the linear equation. The consequence of this is inflated exponential and power function fits relative to the linear fit.
Is there a way to account for this using lmer()? Alternatively, how would this be done using non-linear mixed effects modelling? I've attempted to do it with nlme(), nlmer(), glmer() but all methods end up running into issues (e.g., do not converge).
Here is sample data:
#Create Empty Matrix
lmerdata <- matrix(NA, 20, 3)

#Add Participant IDs
lmerdata[, 1] <- rep(1:4, 5)

#Add Trial Counts
lmerdata[, 2] <- as.numeric(sort(rep(1:5, 4)))

#Add Reaction Time Data
lmerdata[, 3] <- c(2.184308,2.754287,2.396167,1.305267,1.943866,1.70844,2.586035,1.261954,1.768063,1.76659,2.242142,1.489634,1.62544,1.677268,2.378175,1.550744,1.481052,1.424327,1.738102,1.247097)

#Name Columns
colnames(lmerdata) <- c('Subjects', 'Trial', 'ReactionTime')

#Convert to Data Frame
lmerdata <- as.data.frame(lmerdata)

#Turn Subjects into Factor
lmerdata$Subjects <- as.factor(lmerdata$Subjects)

 A: Before you decide on a model, I would recommend you start by visualising your data.  In this case you have four subjects being tested over five trials, and in each case they have a given reaction time.  The data shows that the reaction times tend to decrease for later trials, but this is easier to see if we plot the data.  This is a useful exploratory measure to see if there is any obvious functional pattern in the data.
Once we plot the data we see that three of the subjects have decreasing reaction times and one does not.  With such a small amount of data (few subjects and only five trials) it is extremely difficult to distinguish between different functional forms of change in the reaction time, and so any of the models are likely to perform similarly well.  The exponential model is preferable from a theoretical standpoint, insofar as it can be extrapolated without yielding negative reactions times.  As to whether you need to use a linear mixed model, that is certainly one approach you could use, which would allow for correlation in the error terms in the model.  An alternative approach would be to use a model that allows different rates of decrease in reaction time for different subjects, and in my view, this latter method would be simpler.

#Load ggplot and set theme
library(ggplot2);
library(viridis);
THEME <- theme(plot.title    = element_text(hjust = 0.5, size = 14, face = 'bold'),
               plot.subtitle = element_text(hjust = 0.5, face = 'bold'));

#Create time-series plot
FIGURE <- ggplot(aes(x = Trial, y = ReactionTime, colour = factor(Subjects)), 
                 data = lmerdata) +
          geom_line(size = 2) +
          scale_y_continuous(limits = c(0, 4)) +
          scale_color_brewer(palette = 'Set1') +
          THEME + theme(legend.position = 'none') +
          ggtitle('Reaction Times of Subjects') +
          ylab('Reaction Time \n (unspecified units)');

#Print plot
FIGURE;

A: The sample data you posted appears to be approximately bimodal, and if this is true of the actual study data then a single model is insufficient. Here is my histogram of the sample data to show why I say this:

