Description Usage Arguments Value
View source: R/util-regression.R
Split a column of data by membership in discrete groups (as with factor levels) data into multiple columns containing just the values corresponding to the membership indicator associated with the column and zeros otherwise.
1 | regressor.split(regressor, membership = NULL)
|
regressor |
The vector of data to be split |
membership |
A vector of the same length as the regressor that assigns group membership categorically. If the regressor is a factor, no membership assignment is required. |
A matrix of length(sort(unique(membership))) columns, that is all zeros except for the regressor values that match the membership values corresponding to the column. This supports regression with separate coefficints for each group defined by the membership for example, regressor.split(Tout,dates$hour) will return a matrix with 24 columns, where the only non-zero entry per row contains the Tout value in the column corresponding to the hour of day it was recorded
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.