Description Usage Arguments Value Author(s) Examples
Center a continuous variable under the levels of a categorical variable, typically a random factor. The function returns the values of x centered at the means of x under each level of the group variable.
1 | groupcenter(x,group)
|
x |
A vector with numerical values |
group |
A vector with categorical values |
A vector with group-centered x values.
Joost van de Weijer
1 2 | dfr=data.frame(subject=c(1,1,1,2,2,2,3,3,3),dv=c(2,4,1, 6,1,2, 4,3,3))
groupcenter(dfr$dv,group=dfr$subject)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.