Code
head(x)
Output
Sepal.Length_between Petal.Length_between Sepal.Length_within
1 5.925000 3.527500 -0.8250000
2 5.925000 3.527500 -1.0250000
3 5.925000 3.527500 -1.2250000
4 5.862222 3.951111 -1.2622222
5 5.925000 3.527500 -0.9250000
6 5.862222 3.951111 -0.4622222
Petal.Length_within
1 -2.127500
2 -2.127500
3 -2.227500
4 -2.451111
5 -2.127500
6 -2.251111
Code
head(x)
Output
Sepal.Length_between binary_between Species_between Species_setosa_between
1 5.925000 0.375 0.850000 0.4250000
2 5.925000 0.375 0.850000 0.4250000
3 5.925000 0.375 0.850000 0.4250000
4 5.862222 0.400 1.133333 0.2888889
5 5.925000 0.375 0.850000 0.4250000
6 5.862222 0.400 1.133333 0.2888889
Species_versicolor_between Species_virginica_between Sepal.Length_within
1 0.3000000 0.2750000 -0.8250000
2 0.3000000 0.2750000 -1.0250000
3 0.3000000 0.2750000 -1.2250000
4 0.2888889 0.4222222 -1.2622222
5 0.3000000 0.2750000 -0.9250000
6 0.2888889 0.4222222 -0.4622222
binary_within Species_within Species_setosa_within Species_versicolor_within
1 -0.375 -0.850000 0.5750000 -0.3000000
2 0.625 -0.850000 0.5750000 -0.3000000
3 -0.375 -0.850000 0.5750000 -0.3000000
4 0.600 -1.133333 0.7111111 -0.2888889
5 0.625 -0.850000 0.5750000 -0.3000000
6 -0.400 -1.133333 0.7111111 -0.2888889
Species_virginica_within
1 -0.2750000
2 -0.2750000
3 -0.2750000
4 -0.4222222
5 -0.2750000
6 -0.4222222
Code
head(x)
Output
Sepal.Length Sepal.Width Petal.Length Petal.Width Species ID binary
1 5.1 3.5 1.4 0.2 setosa 3 0
2 4.9 3.0 1.4 0.2 setosa 3 1
3 4.7 3.2 1.3 0.2 setosa 3 0
4 4.6 3.1 1.5 0.2 setosa 2 1
5 5.0 3.6 1.4 0.2 setosa 3 1
6 5.4 3.9 1.7 0.4 setosa 2 0
Sepal.Length_between Petal.Length_between Sepal.Length_within
1 5.925000 3.527500 -0.8250000
2 5.925000 3.527500 -1.0250000
3 5.925000 3.527500 -1.2250000
4 5.862222 3.951111 -1.2622222
5 5.925000 3.527500 -0.9250000
6 5.862222 3.951111 -0.4622222
Petal.Length_within
1 -2.127500
2 -2.127500
3 -2.227500
4 -2.451111
5 -2.127500
6 -2.251111
Code
demean(dat, select = c("a", "x*y"), by = "ID", append = FALSE)
Output
a_between x_y_between a_within x_y_within
1 2.666667 4.666667 -1.6666667 -0.6666667
2 2.333333 4.000000 -0.3333333 2.0000000
3 2.500000 4.500000 0.5000000 -1.5000000
4 2.666667 4.666667 1.3333333 3.3333333
5 2.333333 4.000000 -1.3333333 0.0000000
6 2.500000 4.500000 -0.5000000 1.5000000
7 2.666667 4.666667 0.3333333 -2.6666667
8 2.333333 4.000000 1.6666667 -2.0000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.