View source: R/datacggm_tools.R
nobs + nresp + npred | R Documentation |
Extract the number of observations, response variables and predictors from an object of class datacggm
.
## S3 method for class 'datacggm' nobs(object, ...) ## S3 method for class 'datacggm' nresp(object, ...) ## S3 method for class 'datacggm' npred(object, ...)
object |
an R object of class |
... |
further arguments to be passed to methods. |
Luigi Augugliaro (luigi.augugliaro@unipa.it)
datacggm
, rcggm
and dim.datacggm
.
set.seed(123) n <- 100 p <- 3 q <- 2 b0 <- rep(1, p) X <- matrix(rnorm(n * q), n, q) B <- matrix(rnorm(q * p), q, p) Sigma <- outer(1:p, 1:p, function(i, j) 0.3^abs(i - j)) probl <- 0.05 probr <- 0.05 probna <- 0.05 Z <- rcggm(n = n, b0 = b0, Sigma = Sigma, probl = probl, probr = probr, probna = probna) nobs(Z) nresp(Z) npred(Z) Z <- rcggm(b0 = b0, X = X, B = B, Sigma = Sigma, probl = probl, probr = probr, probna = probna) nobs(Z) nresp(Z) npred(Z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.