View source: R/datacggm_tools.R
| ColMeans + ColMeans | R Documentation |
Retrieve column means and column variances of a “datacggm” object.
ColMeans(x)
ColVars(x)
x |
an object of class ‘ |
For an R object x of class ‘datacggm’, ColMeans (ColVars) retrieves the column means (variances) of the matrices obtained by getMatrix(x, "Y") and getMatrix(x, "X"). For the response variables, marginal means and variances are estimated using a EM-algorithm under the assumption that the p response variables are marginally normally distributed (see also Details section in datacggm). For the numeric predictor variables, marginal means and variances are computed by mean and var, whereas, for categorical data, ColMeans (ColVars) retrieves the statistical mode and the Gini-Simpson Index, respectively.
ColMeans (ColVars) returns a named list with the columns means (variances).
Luigi Augugliaro (luigi.augugliaro@unipa.it)
datacggm, rcggm, qqcnorm and hist.datacggm.
set.seed(123)
n <- 1000L
p <- 3L
b0 <- rep(0, p)
Z <- rcggm(n = n, b0 = b0, probl = 0.05, probr = 0.05)
ColMeans(Z)
ColVars(Z)
n <- 1000L
p <- 3L
q <- 2
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
Z <- rcggm(n = n, b0 = b0, X = X, B = B, probl = 0.05, probr = 0.05)
ColMeans(Z)
ColVars(Z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.