H | R Documentation |
H
creates a two way id by features table that can be used as the H argument in the rrc
function that extracts latent covariates.
H(timevar=NULL, idvar=NULL, response=NULL, Gu=NULL)
timevar |
vector of the dataset containing the variable to be used to form columns in the wide table. |
idvar |
vector of the dataset containing the variable to be used to form rows in the wide table. |
response |
vector of the dataset containing the response variable to be used to fill the cells of the wide table. |
Gu |
an optional covariance matrix (not the inverse) between levels of the idvar in case a sparse (unbalanced) design between timevar and idvar exist. |
This is just an aggregate, reshape and imputation of a long format table to a wide format table.
two way table of id by features effects.
Giovanny Covarrubias-Pazaran
The function vsc
to know how to use H
in the rrc
function.
# data(DT_h2)
# DT <- DT_h2
# DT=DT[with(DT, order(Env)), ]
# H0 <- with(DT, H(Env, Name, y) )
# Z <- with(DT, rrc(Env, H0, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.