nobs.datacggm: Extract the Number of Observations/Responses/Predictors from...

Description Usage Arguments Author(s) See Also Examples

View source: R/datacggm_tools.R

Description

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

Usage

1
2
3
4
5
6
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

cglasso documentation built on April 9, 2021, 9:07 a.m.