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 -0.434898409 3.782242 1.351715 2.9427369  1.7949214 4.7545013 2.2836476
#> 2   2 -1.737297255 2.153713 2.448050 6.4307622  0.8202692 0.8099121 4.1523962
#> 3   3 -1.263695600 3.187589 4.987633 6.4153168  6.5465086 3.1278372 1.3172155
#> 4   4  0.406308512 3.108124 3.289756 6.9083992  5.1656045 4.7647438 0.2918487
#> 5   5 -1.459653968 2.499432 3.046025 0.4712187 -2.3845844 3.5944713 3.8803803
#> 6   6  1.048457370 0.299359 4.619669 3.4303420  5.3557826 0.9536217 1.1252707
#> 7   7 -1.346430539 2.782637 4.554230 5.1525935  3.7179767 4.2753833 3.1269512
#> 8   8 -0.193570558 2.952590 4.102005 4.9740751  1.9156244 2.2832942 3.1343173
#> 9   9 -0.002335957 4.250033 1.626440 0.6906344  1.2766068 3.2450412 1.9506263
#> 10 10 -0.012829734 5.433353 3.812659 6.2252314  3.2612792 4.8918429 5.0229852
#>          y3t1     y4t1       y1t2       y2t2        y3t2       y4t2     y1t3
#> 1   2.2800796 1.545085  3.6404985  2.0661432  2.46226309  3.3430296 6.261274
#> 2   4.6597573 1.445941  1.7945394  3.0821225  5.49946361  1.7598261 1.706360
#> 3   3.2713902 2.056381  3.8656836  5.3791597  5.28948442  4.4328089 3.912252
#> 4   1.8553591 3.742105  4.5223464  1.3612592  2.63381217  4.1658952 3.304857
#> 5  -0.1664978 2.529035  3.2937047  1.5898308 -0.06461959  0.5358452 4.090840
#> 6   3.1265891 1.472146  1.9770195  3.6907168  6.31785544  6.6038299 3.282751
#> 7   1.7793689 3.670097  2.0724988  3.4258927  2.00656735  4.0343981 4.055913
#> 8   3.7826602 1.057187  1.3915526  3.7066773  3.04693688  2.0324709 1.278664
#> 9   1.8041649 4.751561  1.1375511 -0.7129968  0.08363337  1.2912565 4.924558
#> 10  5.3178785 1.589557 -0.7770755 -1.3727677 -1.77426217 -1.9393138 7.155552
#>         y2t3        y3t3      y4t3      y1t4       y2t4       y3t4       y4t4
#> 1  3.3773335  4.24495050  4.567762  2.597836  2.3624999  1.6390733  0.6512027
#> 2  2.5309273  4.74309474  1.061035  3.539222  3.6056807  5.4873518  0.8585451
#> 3  4.2702215  5.07898106  3.673591 -1.015005  0.5103997 -1.6658645 -1.2411368
#> 4  0.3935612  5.37047178  4.426303  1.096204 -0.7752972  2.3638727  3.5877719
#> 5  3.0764778 -0.07384367 -2.829576  3.947661  3.3552241 -0.4647369 -1.1693167
#> 6  2.4855965  3.30710884  5.360090  1.127334  5.0197537  4.0950866  3.8396742
#> 7  4.3559035  2.99335834  5.837571  4.052356  3.7017661  3.0428572  5.4234873
#> 8  4.7417310  3.74977382  2.752900  1.815274  2.0898185  3.7224588  2.4132507
#> 9  0.7214674  2.14612087  3.449438  2.518486  0.6776673  0.7536733  0.8825943
#> 10 5.6849615  6.10065068  3.670067  4.413898  7.8400176  7.6913321  5.6675081
#>          y1t5      y2t5       y3t5        y4t5
#> 1   6.7140408 2.7358992  2.6179755  2.13149113
#> 2   0.1362200 1.9693966  1.9823002 -0.02665275
#> 3  -0.6500289 0.5742261 -0.8800453 -1.67944259
#> 4   4.7573703 0.3594832  1.5869248  3.75196861
#> 5   2.0335680 1.5504328 -0.2187459 -2.28358134
#> 6   0.8246693 2.3510496  2.3772615  2.91348036
#> 7   1.3492794 3.3772932  1.9984974  1.77056520
#> 8   4.4929101 5.3540349  2.0714714  1.31843979
#> 9   3.2608315 0.8333539  4.4592592  3.49847189
#> 10  4.7303793 4.3591860  4.5074282  4.50461219