This function describes the structure of sub-regression given by an adjacency matrix. It computes the associated regression coefficients and R-squared for each sub-regression.
readZ( Z = Z, B = NULL, crit = c("none", "R2", "F", "sigmaX"), varnames = NULL, output = c("index", "names", "all"), X = NULL, order = 1 )
Z | binary adjacency matrix of the structure (size p) |
---|---|
B | is the complete structure (Z with sub-regression coefficients instead of 1 and an additional first line for the intercepts) |
crit | define the criterion to use: c("none","R2","F","sigmaX") |
varnames | the names of the variables (size p) |
output | indicates the content of the output: c("index","names","all") |
X | is a data frame or matrix containing the dataset |
order | define the order used (0: none, -1: decreasing, 1: growing) for printing |
a list containing the sub-regressions details. Each item of the list represents a subregression. First element is the R-square.Second element is the variable that is regressed by others. Then comes the list of the explicative variables in the subgression and the associated coefficients (in the first column).
data <- mtcars # we first search a sub-regression structure res <- structureFinder(X = data, nbini = 30, verbose = 0)#> convergence atteinte# then we can try to interpret it readZ(Z = res$Z_opt, crit = "R2", output = "all", X = data)#> [[1]] #> coefs var #> 1 0.301934038255522 R2 #> 2 <NA> carb #> 3 3.61111111111111 intercept #> 4 -1.82539682539683 vs #> #> [[2]] #> coefs var #> 1 0.618213625231169 R2 #> 2 <NA> am #> 3 -1.57407407407407 intercept #> 4 0.537037037037037 gear #> #> [[3]] #> coefs var #> 1 0.814444825776762 R2 #> 2 <NA> mpg #> 3 19.7462225964812 intercept #> 4 -5.04798198284328 wt #> 5 0.929197979568392 qsec #> #> [[4]] #> coefs var #> 1 0.892191730630429 R2 #> 2 <NA> cyl #> 3 7.10631838441982 intercept #> 4 0.00489383903373326 disp #> 5 0.00675999840002715 hp #> 6 -0.721514793996899 drat #> 7 -1.01615615142963 vs #># each component is a sub-regression # First line: The adjusted R-squared is given # Second line: the name of the covariate that is regressed by others # other lines: Coefficients of sub-regression and name of the associated covariate