powered by
This function allows you to center on person-means (also called "centering within clusters")
pcenter(ID, var)
name of ID variable
name of variable to be centered
A column in your dataframe (with person-centered data)
# NOT RUN { data$centeredVAR<-pcenter(data$ID,data$var) # }
Run the code above in your browser using DataLab