I am an experimentalist and want to run the linear regression to control for the within-subject correlation that violates the assumption of independence. With the practice in the field of economics,normally we take the cluster standard error into account, see below both the Stata and R code examples that achieve exact same results. From the perspective of psychology, it prefers to emphasize the random effect of the intercepts/slopes. Here I have two questions.
1. How can I get the same or similar results as I achieved above with the lmer command in lme4 package of R? I've listed the lmer command below but the results turn out to be different.
2. How can I explain the details to a psychologist what the clustered standard error method achieves with HLM terminology, can we understand it has already considered the random effect of the intercept of the with-subject factor Species but with the fixed slope of X(Sepal.Width, Petal.Length and Petal.Width)?
stata code
use http://www.stata-press.com/data/r17/iris, clear
reg seplen sepwid petlen petwid,cluster(iris)
R code
library(lfe)
OLS1<-felm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width |0|0|Species,data=iris)
summary(OLS1)$coe
library(lme4)
fm1 <- lmer(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+ (1 | Species), iris)
summary(fm1)