Description Usage Arguments Details Value Author(s) See Also Examples

Returns a category-weighted contrast matrix

1 | ```
contr.wsum(x, weights = rep.int(1.0, length(x)), sparse = FALSE)
``` |

`x` |
a factor vector |

`weights` |
a vector of weights with the same length as |

`sparse` |
ogical indicating if the result should be sparse (of class |

Computes a contrast matrix similar to `contr.sum`

. The
reference category is however weighted by the sum of weights of the
other categories.

A matrix with `nlevels(x)`

rows and `nlevels(x)- 1`

columns.

Reto Buergin

1 2 3 | ```
x <- factor(rep(LETTERS[1:3], c(10, 20, 30)))
contr.wsum(x) # standard call
contr.wsum(x, sparse = TRUE) # using a sparse matrix
``` |

vcrpart documentation built on Feb. 16, 2018, 1:03 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.