Skip to contents

Coerce an Object of Class simculta to a Data Frame

Usage

# S3 method for class 'simculta'
as.data.frame(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.data.frame(x)
#>    id    covariate       y1t0       y2t0      y3t0       y4t0     y1t1
#> 1   1 -0.004620768  3.1080489  0.9977467 1.9215219  1.9913586 1.735842
#> 2   2  0.760242168  0.2148366  3.0801909 2.2184058  3.0055116 1.046777
#> 3   3  0.038990913  0.9357182  1.0261230 2.9676951  2.0899550 1.218255
#> 4   4  0.735072142  1.6861361  1.8079013 5.8638165  4.4365411 4.894756
#> 5   5 -0.146472627  4.3736118  4.5153714 4.0347804  4.5687132 4.724019
#> 6   6 -0.057887335 -0.3134992 -0.7459390 0.5908366  0.7720265 1.191869
#> 7   7  0.482369466  4.7593152  4.5588281 5.6519466  3.9214528 2.367309
#> 8   8  0.992943637  2.2281491  3.9195557 1.2356924 -3.3121952 1.484396
#> 9   9 -1.246395498  4.4981812  3.7879362 2.6990034  3.0419821 2.827395
#> 10 10 -0.033487525  4.6622691  3.1374319 3.6806854  4.1330110 5.409956
#>          y2t1       y3t1       y4t1       y1t2      y2t2        y3t2       y4t2
#> 1   3.3132902  0.8480728  0.6353742 3.45234853 4.6961437  3.59359462  3.1308017
#> 2   0.8543377  2.3989481  2.7637442 1.36956914 0.7266768 -0.03581078  2.9290683
#> 3  -0.6529763  3.9881195  1.3368407 1.19912011 1.3169599  3.95629368  0.8505573
#> 4   2.7343161  4.5287947  5.2618782 0.05458483 2.9742862  5.84936334  3.6466179
#> 5   5.0922759  1.3350222  4.2709694 3.84755520 4.6749262  3.02810194  4.9069587
#> 6   1.7741249 -0.1773161  0.7073458 0.65736841 1.0160142 -0.19055801 -1.2846326
#> 7   1.0347139  3.7434848  2.1976113 3.64496018 5.3416135  7.51682691  4.7614086
#> 8   3.8106610  1.6964474 -0.6895025 2.50317989 2.4757882  2.11031173 -4.1017037
#> 9   5.0742026  2.7981488  2.9945713 2.77875823 2.3588352  2.16833467  3.9011940
#> 10  4.1790619  6.6055497  4.4502146 5.11115263 3.8761384  5.73296149  7.1324909
#>         y1t3       y2t3     y3t3       y4t3       y1t4       y2t4      y3t4
#> 1  3.6606035  4.2484156 2.464539  4.3682827  2.0073919  2.9807503 2.7819935
#> 2  0.9284153  1.6185724 2.118673  5.2652824  0.6396574  2.6909793 3.3474468
#> 3  1.0863579 -0.6222904 1.240434 -0.6683905  2.5199385  2.3624915 5.4429970
#> 4  3.0584306  3.3694957 3.891540  6.3831308  0.5614583  0.9992108 3.0465904
#> 5  1.9252602  2.0809743 1.030734  3.9444482  3.7363469  4.6899855 3.9401640
#> 6  0.8610324  4.6884660 3.031159  0.7146361 -0.8399775 -1.0492283 0.8369085
#> 7  2.2412320  2.5362055 2.930550  1.3697794  3.5420678  3.6801061 4.3657132
#> 8  1.9701487  3.7960511 4.932898 -1.1731110  3.0874226  2.5875204 3.2208770
#> 9  3.7694387  5.4419680 2.641453  4.9425494  3.9605453  4.5688973 0.8046080
#> 10 5.3584433  2.9613678 6.241951  6.7827407  3.1331554  3.3444586 6.6483184
#>         y4t4      y1t5       y2t5      y3t5         y4t5
#> 1   1.797176 3.4469161  5.1526509 2.3515011  2.604708276
#> 2   3.951945 1.0914945  1.7710993 3.3119473  5.651994999
#> 3   2.722895 1.3155782 -0.5115318 3.5265271  1.581773524
#> 4   3.335513 0.2614324  2.2514080 3.6468394  1.740718838
#> 5   4.615780 0.8992359  3.8539116 4.3006589  3.534691886
#> 6  -2.156528 0.8719246 -1.3303913 0.5612111 -0.004986769
#> 7   5.120022 3.6043052  2.8104507 2.6920887  1.596079397
#> 8  -1.587495 2.1609117  4.8926099 4.5102523  0.463074095
#> 9   2.674186 4.2170706  5.2917078 3.3805426  3.902502867
#> 10  4.160614 3.7891796  2.9959138 4.6544914  5.727958749