How to make a linear model with a constant value in R?
To use only a single parameter, which will be a constant, you have to specify the lm formula as follows: y ~ 1. R will then fit the model, where the coefficient for this constant will be equal to the mean of y, see also this stats stackexchange answer.