| pcenter | R Documentation |
This function allows you to center on person-means (also called "centering within clusters")
pcenter(ID, var)
ID |
name of ID variable |
var |
name of variable to be centered |
A column in your dataframe (with person-centered data)
df <- data.frame(ID = c(1, 1, 2, 2), var = c(1, 3, 5, 9))
df$centeredVAR <- pcenter(df$ID, df$var)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.