nobs + nresp + npred {cglasso}R Documentation

Extract the Number of Observations/Responses/Predictors from a datacggm Object

Description

Extract the number of observations, response variables and predictors from an object of class datacggm.

Usage

## S3 method for class 'datacggm'
nobs(object, ...)
## S3 method for class 'datacggm'
nresp(object, ...)
## S3 method for class 'datacggm'
npred(object, ...)

Arguments

object

an R object of class datacggm.

...

further arguments to be passed to methods.

Author(s)

Luigi Augugliaro (luigi.augugliaro@unipa.it)

See Also

datacggm, rcggm and dim.datacggm.

Examples

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)

[Package cglasso version 2.0.7 Index]