Skip to contents

Coerce an Object of Class simculta to a Matrix

Usage

# S3 method for class 'simculta'
as.matrix(x, ...)

Arguments

x

Object of class simculta.

...

Additional arguments.

Author

Ivan Jacob Agaloos Pesigan

Examples

x <- GenCULTA2Profiles(
  n = 10,
  m = 6,
  common_trait_loading = matrix(
    data = c(1, 1.25, 1.50, 1.75),
    ncol = 1
  ),
  common_state_loading = matrix(
    data = c(1, 1.5, 1.75, 2.00),
    ncol = 1
  ),
  mu_t = NULL,
  psi_t = NULL,
  mu_p = NULL,
  psi_p = NULL,
  theta = diag(4),
  mu_profile = cbind(
    c(-3, -3, -3, -3),
    c(3, 3, 3, 3)
  ),
  mu_x = 0,
  sigma_x = 1,
  nu_0 = -3.563,
  kappa_0 = 0.122,
  alpha_0 = -3.586,
  beta_00 = 2.250,
  gamma_00 = 0.063,
  gamma_10 = 0.094,
  phi_0 = 0.311,
  phi_1 = 0,
  psi_s0 = 0.151,
  psi_s = 0.290
)
as.matrix(x)
#>    id    covariate     y1t0     y2t0     y3t0     y4t0        y1t1      y2t1
#> 1   1 -1.983009479 1.935365 3.745871 1.364566 1.701855  4.18332854  2.747512
#> 2   2 -0.219599804 2.879605 4.366086 5.053028 6.920815  4.48101918  4.580698
#> 3   3  1.045275869 5.196590 5.681926 6.825355 5.377838  4.72846546  3.907936
#> 4   4  1.877329566 2.881662 3.584416 1.225822 1.720035 -1.84670951 -2.854165
#> 5   5  0.002606196 3.516095 3.597233 1.393627 1.166944  2.45575263  5.557888
#> 6   6 -0.080669935 1.635176 1.894422 3.355718 5.707425  3.46023526  1.162914
#> 7   7  0.962982281 6.651101 4.604233 6.453623 7.990556  5.84199343  4.252758
#> 8   8  0.053571017 1.448337 2.409726 6.369498 8.244134  3.38787170  5.433822
#> 9   9 -0.434898409 1.229037 1.633926 1.710707 1.918163  0.07559754  1.466063
#> 10 10 -1.737297255 4.117725 1.879963 3.461637 1.585253  5.58562177  3.524630
#>          y3t1       y4t1       y1t2      y2t2        y3t2       y4t2      y1t3
#> 1   3.2068428  0.8113813  0.9095797  2.608498 -0.08069906 -0.1582283 2.0764357
#> 2   6.1054445  8.0362324  3.7619039  4.228701  5.29879749  8.7945633 3.7541588
#> 3   5.1989012  4.7400166  4.6385099  6.018249  4.69365731  4.4609117 5.0611689
#> 4  -5.3870055 -3.0535510 -1.6701116 -3.070749 -4.50804314 -3.0060741 1.1130136
#> 5   3.3917156  1.7134325  1.7949735  4.802798  3.65713816  2.4544106 3.7535511
#> 6   5.7435932  4.7142935  3.6178408  1.588543  3.97641606  4.7527450 3.2745581
#> 7   2.8602632  4.9794176  4.8495430  4.651606  5.91707893  5.7834760 2.3197027
#> 8   5.1538669  5.2480044  2.0879810  4.101336  5.08700005  4.7423719 4.0563619
#> 9   0.7626519 -0.7897040  2.1754039 -0.199107 -3.09467379 -2.4757455 0.1606699
#> 10  1.4043232  2.9540545  4.0969394  4.333582  3.29546224  5.3292428 6.3439956
#>         y2t3       y3t3      y4t3      y1t4       y2t4       y3t4       y4t4
#> 1  4.4329359  3.0900213  1.876820  1.050714  3.6581381  2.0643827  0.1759829
#> 2  6.1406923  5.5989344 10.265874  3.291692  5.1757668  4.1114430  5.1965724
#> 3  4.8043162  5.8033974  2.234707  4.031673  3.3761597  4.4950492  3.9296157
#> 4  2.5333886  0.9816833  1.155072  3.114503  2.5158551 -0.7750244  4.3878009
#> 5  6.4197792  3.5749083  2.620797  2.732721  2.6527038  2.8604171  0.4033026
#> 6  0.8063852  2.5786180  3.024870 -3.384522 -2.7439943 -1.5522302 -1.3149698
#> 7  3.1086343  3.0480726  3.571580  2.754967  5.3511826  6.7289042  4.4813255
#> 8  2.9880311  3.9097630  7.204085  1.295198  0.4752935  2.8023005  4.3122410
#> 9  1.3381695 -0.4119574 -1.082401 -1.259015  0.3888265 -1.3176131 -2.8530258
#> 10 6.0891161  2.9349986  3.318092  6.271778  2.9837199  4.4180837  2.9109767
#>          y1t5       y2t5        y3t5       y4t5
#> 1   1.5798351  3.7510478 -0.09251369  0.7427856
#> 2   3.4528374  5.3010372  8.38104288 10.4120457
#> 3   5.3018227  3.9559178  5.18055614  3.8186870
#> 4   4.9510353  4.9660349  0.90628527  2.6536198
#> 5   0.8227236  5.3478833  1.36275577 -0.7789928
#> 6   2.3467674 -0.0083522  3.27710285  1.7446696
#> 7   5.1024621  6.7760830  7.97914621  6.6176736
#> 8   3.0621063  3.6710564  3.18474040  2.6530429
#> 9  -6.7593672 -6.0362433 -7.04019584 -6.1904019
#> 10  5.4792772  3.3074747  2.49676568  2.0490818