Skip to content

Commit

Permalink
Automated build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeksterslab committed Oct 8, 2024
1 parent c3ee5c5 commit c1a1681
Show file tree
Hide file tree
Showing 57 changed files with 5,917 additions and 437 deletions.
Binary file modified .setup/build/semmcci.pdf
Binary file not shown.
Binary file modified .setup/build/semmcci_1.1.4.9000.tar.gz
Binary file not shown.
Binary file modified .setup/data-raw/benchmark/benchmark-complete-01.Rds
Binary file not shown.
Binary file modified .setup/data-raw/benchmark/benchmark-complete-02.Rds
Binary file not shown.
Binary file modified .setup/data-raw/benchmark/benchmark-fiml-01.Rds
Binary file not shown.
Binary file modified .setup/data-raw/benchmark/benchmark-fiml-02.Rds
Binary file not shown.
Binary file modified .setup/data-raw/benchmark/benchmark-mi-01.Rds
Binary file not shown.
Binary file modified .setup/data-raw/benchmark/benchmark-mi-02.Rds
Binary file not shown.
9 changes: 6 additions & 3 deletions .setup/latex/bib/bib.bib
Original file line number Diff line number Diff line change
Expand Up @@ -4934,13 +4934,16 @@ @Article{Orth-Clark-Donnellan-etal-2021
publisher = {American Psychological Association (APA)},
}

@Article{Park-Chow-Epskamp-etal-2023,
@Article{Park-Chow-Epskamp-etal-2024,
author = {Jonathan J. Park and Sy-Miin Chow and Sacha Epskamp and Peter C. M. Molenaar},
date = {2023},
date = {2024-02},
journaltitle = {Multivariate Behavioral Research},
title = {Subgrouping with chain graphical {VAR} models},
doi = {10.1080/00273171.2023.2289058},
pages = {1--23},
issn = {1532-7906},
number = {3},
pages = {543--565},
volume = {59},
abstract = {Recent years have seen the emergence of an ``idio-thetic'' class of methods to bridge the gap between nomothetic and idiographic inference. These methods describe nomothetic trends in idiographic processes by pooling intraindividual information across individuals to inform group-level inference or vice versa. The current work introduces a novel ``idio-thetic'' model: the subgrouped chain graphical vector autoregression (scGVAR). The scGVAR is unique in its ability to identify subgroups of individuals who share common dynamic network structures in both lag(1) and contemporaneous effects. Results from Monte Carlo simulations indicate that the scGVAR shows promise over similar approaches when clusters of individuals differ in their contemporaneous dynamics and in showing increased sensitivity in detecting nuanced group differences while keeping Type-I error rates low. In contrast, a competing approach–the Alternating Least Squares VAR (ALS VAR) performs well when groups were separated by larger distances. Further considerations are provided regarding applications of the ALS VAR and scGVAR on real data and the strengths and limitations of both methods.},
publisher = {Informa UK Limited},
}
Expand Down
11 changes: 0 additions & 11 deletions .setup/latex/bib/quarto.bib

This file was deleted.

Binary file modified .setup/latex/figures/pdf/cfa.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/kwan-2011-example-1.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/kwan-2011-example-2.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/kwan-2011-example-two-regressors.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/latent.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/regression.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/serial.pdf
Binary file not shown.
Binary file modified .setup/latex/figures/pdf/simple.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions .setup/latex/pdf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
*/
!*.pdf
!.gitignore
!bib.bib
5,469 changes: 5,469 additions & 0 deletions .setup/latex/pdf/bib.bib

Large diffs are not rendered by default.

Binary file added .setup/latex/pdf/semmcci-001-description.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/semmcci-999-session.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/semmcci-zzz-references.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/semmcci-zzz-tests-benchmark.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/semmcci-zzz-tests-external.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/semmcci-zzz-tests-internal.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/semmcci-zzz-tests-staging.pdf
Binary file not shown.
6 changes: 0 additions & 6 deletions R/semmcci-mc-ci-dot.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
#' @noRd
.MCCI <- function(object,
alpha = NULL) {
stopifnot(
inherits(
object,
"semmcci"
)
)
thetahatstar <- object$thetahatstar
thetahat <- object$thetahat
if (is.null(alpha)) {
Expand Down
4 changes: 2 additions & 2 deletions R/semmcci-mc-generic.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ MCGeneric <- function(object,
}
if (
inherits(
object,
"lavaan"
x = object,
what = "lavaan"
)
) {
location <- lavaan::coef(object)[def_vars]
Expand Down
16 changes: 8 additions & 8 deletions R/semmcci-mc-mi.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ MCMI <- function(lav,
seed = NULL) {
stopifnot(
inherits(
lav,
"lavaan"
x = lav,
what = "lavaan"
)
)
if (lav@Data@data.type == "moment") {
Expand All @@ -107,8 +107,8 @@ MCMI <- function(lav,
}
if (
inherits(
mi,
"mids"
x = mi,
what = "mids"
)
) {
imp <- mice::complete(
Expand All @@ -117,15 +117,15 @@ MCMI <- function(lav,
)
} else if (
inherits(
mi,
"amelia"
x = mi,
what = "amelia"
)
) {
imp <- mi$imputations
} else if (
inherits(
mi,
"list"
x = mi,
what = "list"
)
) {
imp <- mi
Expand Down
4 changes: 2 additions & 2 deletions R/semmcci-mc-std.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ MCStd <- function(mc,
alpha = c(0.001, 0.01, 0.05)) {
stopifnot(
inherits(
mc,
"semmcci"
x = mc,
what = "semmcci"
)
)
stopifnot(
Expand Down
4 changes: 2 additions & 2 deletions R/semmcci-mc.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ MC <- function(lav,
seed = NULL) {
stopifnot(
inherits(
lav,
"lavaan"
x = lav,
what = "lavaan"
)
)
args <- list(
Expand Down
2 changes: 1 addition & 1 deletion R/semmcci-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' use the argument `alpha` used in `x`.
#' @param digits Integer indicating the number of decimal places to display.
#' @param ... further arguments.
#' @return Returns a matrix of estimates, standard errors,
#' @return Prints a matrix of estimates, standard errors,
#' number of Monte Carlo replications, and confidence intervals.
#'
#' @examples
Expand Down
88 changes: 44 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
semmcci
================
Ivan Jacob Agaloos Pesigan
2024-10-01
2024-10-08

<!-- README.md is generated from .setup/readme/README.Rmd. Please edit that file -->

Expand Down Expand Up @@ -84,12 +84,12 @@ library(lavaan)
``` r
summary(df)
#> X M Y
#> Min. :-2.83590 Min. :-3.39632 Min. :-3.10445
#> 1st Qu.:-0.67337 1st Qu.:-0.71509 1st Qu.:-0.72742
#> Median :-0.00771 Median :-0.10422 Median :-0.02411
#> Mean :-0.02052 Mean :-0.05667 Mean :-0.02289
#> 3rd Qu.: 0.64278 3rd Qu.: 0.59442 3rd Qu.: 0.68659
#> Max. : 3.02822 Max. : 3.55209 Max. : 3.51176
#> Min. :-3.50967 Min. :-3.00067 Min. :-4.18793
#> 1st Qu.:-0.71504 1st Qu.:-0.71011 1st Qu.:-0.68311
#> Median :-0.01692 Median :-0.04121 Median :-0.05995
#> Mean :-0.00513 Mean :-0.03631 Mean :-0.01269
#> 3rd Qu.: 0.66690 3rd Qu.: 0.65676 3rd Qu.: 0.67217
#> Max. : 2.97956 Max. : 3.13662 Max. : 3.07920
#> NA's :100 NA's :100 NA's :100
```

Expand Down Expand Up @@ -129,18 +129,18 @@ mc <- MC(fit, R = 20000L, alpha = 0.05)
mc
#> Monte Carlo Confidence Intervals
#> est se R 2.5% 97.5%
#> cp 0.2437 0.0317 20000 0.1818 0.3064
#> b 0.5041 0.0304 20000 0.4440 0.5626
#> a 0.5330 0.0299 20000 0.4742 0.5911
#> X~~X 0.9810 0.0460 20000 0.8918 1.0720
#> Y~~Y 0.5520 0.0271 20000 0.4985 0.6061
#> M~~M 0.7483 0.0360 20000 0.6777 0.8191
#> Y~1 0.0059 0.0253 20000 -0.0444 0.0558
#> M~1 -0.0339 0.0290 20000 -0.0915 0.0232
#> X~1 -0.0221 0.0325 20000 -0.0853 0.0418
#> indirect 0.2687 0.0222 20000 0.2263 0.3127
#> direct 0.2437 0.0317 20000 0.1818 0.3064
#> total 0.5124 0.0296 20000 0.4544 0.5699
#> cp 0.2627 0.0305 20000 0.2030 0.3224
#> b 0.5249 0.0311 20000 0.4638 0.5860
#> a 0.5304 0.0280 20000 0.4751 0.5851
#> X~~X 1.0645 0.0500 20000 0.9645 1.1612
#> Y~~Y 0.5478 0.0266 20000 0.4954 0.5996
#> M~~M 0.7227 0.0347 20000 0.6546 0.7900
#> Y~1 0.0109 0.0251 20000 -0.0383 0.0610
#> M~1 -0.0365 0.0282 20000 -0.0921 0.0186
#> X~1 -0.0078 0.0340 20000 -0.0742 0.0598
#> indirect 0.2784 0.0218 20000 0.2367 0.3220
#> direct 0.2627 0.0305 20000 0.2030 0.3224
#> total 0.5411 0.0286 20000 0.4851 0.5969
```

### Monte Carlo Confidence Intervals - Multiple Imputation
Expand Down Expand Up @@ -174,15 +174,15 @@ mcmi <- MCMI(fit, mi = mi, R = 20000L, alpha = 0.05, seed = 42)
mcmi
#> Monte Carlo Confidence Intervals (Multiple Imputation Estimates)
#> est se R 2.5% 97.5%
#> cp 0.2436 0.0322 20000 0.1806 0.3065
#> b 0.5029 0.0305 20000 0.4431 0.5621
#> a 0.5335 0.0303 20000 0.4736 0.5928
#> X~~X 0.9826 0.0459 20000 0.8931 1.0724
#> Y~~Y 0.5515 0.0273 20000 0.4986 0.6049
#> M~~M 0.7489 0.0355 20000 0.6787 0.8181
#> indirect 0.2683 0.0220 20000 0.2264 0.3128
#> direct 0.2436 0.0322 20000 0.1806 0.3065
#> total 0.5118 0.0299 20000 0.4533 0.5700
#> cp 0.2604 0.0303 20000 0.2009 0.3199
#> b 0.5266 0.0309 20000 0.4668 0.5863
#> a 0.5316 0.0281 20000 0.4766 0.5869
#> X~~X 1.0672 0.0506 20000 0.9685 1.1666
#> Y~~Y 0.5466 0.0268 20000 0.4940 0.5985
#> M~~M 0.7231 0.0347 20000 0.6548 0.7911
#> indirect 0.2799 0.0218 20000 0.2379 0.3235
#> direct 0.2604 0.0303 20000 0.2009 0.3199
#> total 0.5403 0.0284 20000 0.4852 0.5961
```

### Standardized Monte Carlo Confidence Intervals
Expand All @@ -195,30 +195,30 @@ passing the result of the `MC()` function or the `MCMI()` function to
MCStd(mc, alpha = 0.05)
#> Standardized Monte Carlo Confidence Intervals
#> est se R 2.5% 97.5%
#> cp 0.2414 0.0309 20000 0.1806 0.3019
#> b 0.5109 0.0284 20000 0.4535 0.5644
#> a 0.5209 0.0250 20000 0.4706 0.5684
#> cp 0.2635 0.0302 20000 0.2041 0.3219
#> b 0.5157 0.0280 20000 0.4603 0.5697
#> a 0.5413 0.0243 20000 0.4920 0.5869
#> X~~X 1.0000 0.0000 20000 1.0000 1.0000
#> Y~~Y 0.5522 0.0255 20000 0.5019 0.6020
#> M~~M 0.7286 0.0260 20000 0.6769 0.7785
#> indirect 0.0059 0.0200 20000 0.2270 0.3053
#> direct -0.0335 0.0309 20000 0.1806 0.3019
#> total -0.0223 0.0253 20000 0.4557 0.5555
#> Y~~Y 0.5175 0.0246 20000 0.4697 0.5659
#> M~~M 0.7070 0.0263 20000 0.6555 0.7579
#> indirect 0.0106 0.0196 20000 0.2409 0.3173
#> direct -0.0361 0.0302 20000 0.2041 0.3219
#> total -0.0075 0.0243 20000 0.4928 0.5879
```

``` r
MCStd(mcmi, alpha = 0.05)
#> Standardized Monte Carlo Confidence Intervals
#> est se R 2.5% 97.5%
#> cp 0.2426 0.0316 20000 0.1794 0.3029
#> b 0.5228 0.0283 20000 0.4543 0.5646
#> a 0.5172 0.0250 20000 0.4709 0.5697
#> cp 0.2737 0.0302 20000 0.2021 0.3199
#> b 0.4989 0.0278 20000 0.4630 0.5707
#> a 0.5429 0.0244 20000 0.4938 0.5894
#> X~~X 1.0000 0.0000 20000 1.0000 1.0000
#> Y~~Y 0.5366 0.0256 20000 0.5018 0.6025
#> M~~M 0.7325 0.0261 20000 0.6755 0.7782
#> indirect 0.2704 0.0198 20000 0.2279 0.3056
#> direct 0.2426 0.0316 20000 0.1794 0.3029
#> total 0.5130 0.0260 20000 0.4550 0.5563
#> Y~~Y 0.5279 0.0247 20000 0.4674 0.5648
#> M~~M 0.7053 0.0265 20000 0.6526 0.7561
#> indirect 0.2709 0.0197 20000 0.2425 0.3195
#> direct 0.2737 0.0302 20000 0.2021 0.3199
#> total 0.5446 0.0245 20000 0.4932 0.5889
```

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion man/print.semmcci.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions vignettes/benchmark-complete.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Benchmark: Comparing the Monte Carlo Method with Nonparametric Bootstrapping"
author: "Ivan Jacob Agaloos Pesigan"
date: "2024-10-01"
date: "2024-10-08"
bibliography: "vignettes.bib"
csl: https://raw.githubusercontent.com/citation-style-language/styles/master/apa.csl
nocite: |
Expand Down Expand Up @@ -94,9 +94,9 @@ MC(fit, R = 100L, alpha = 0.05)
#> cp 0.2333 0.0296 100 0.1806 0.2903
#> b 0.5082 0.0279 100 0.4555 0.5527
#> a 0.4820 0.0280 100 0.4220 0.5301
#> X~~X 1.0590 0.0426 100 0.9751 1.1296
#> X~~X 1.0590 0.0426 100 0.9883 1.1428
#> Y~~Y 0.5462 0.0231 100 0.5064 0.5959
#> M~~M 0.7527 0.0337 100 0.7024 0.8208
#> M~~M 0.7527 0.0337 100 0.6846 0.8029
#> indirect 0.2449 0.0179 100 0.2058 0.2738
#> direct 0.2333 0.0296 100 0.1806 0.2903
#> total 0.4782 0.0295 100 0.4162 0.5283
Expand Down Expand Up @@ -175,22 +175,19 @@ benchmark_complete_01 <- microbenchmark(

``` r
summary(benchmark_complete_01, unit = "ms")
#> expr min lq mean median uq max
#> 1 MC 57.4866 65.34062 89.34902 90.13031 109.495 111.8187
#> 2 NB 21120.0967 21183.25395 21307.35418 21297.32431 21383.171 21561.8921
#> neval
#> 1 10
#> 2 10
#> expr min lq mean median uq max neval
#> 1 MC 107.0472 110.6029 130.1915 134.4885 139.3162 163.0922 10
#> 2 NB 30389.4674 30447.2342 31251.4541 30565.6150 31203.4065 34893.3142 10
```

### Summary of Benchmark Results Relative to the Faster Method


``` r
summary(benchmark_complete_01, unit = "relative")
#> expr min lq mean median uq max neval
#> 1 MC 1.0000 1.0000 1.0000 1.0000 1.000 1.0000 10
#> 2 NB 367.3916 324.1973 238.4733 236.2948 195.289 192.8291 10
#> expr min lq mean median uq max neval
#> 1 MC 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 10
#> 2 NB 283.8885 275.2843 240.0422 227.2731 223.9755 213.9484 10
```

## Plot
Expand Down Expand Up @@ -230,8 +227,8 @@ benchmark_complete_02 <- microbenchmark(
``` r
summary(benchmark_complete_02, unit = "ms")
#> expr min lq mean median uq max
#> 1 MC 18.40792 18.45909 19.81844 19.16909 21.20621 21.85372
#> 2 NB 21206.01690 21254.05895 21355.69727 21344.33830 21418.80005 21677.68715
#> 1 MC 34.71615 35.97336 41.09723 38.48091 44.26897 52.48712
#> 2 NB 30351.94804 30593.86637 31340.43989 30758.84186 30859.84223 35055.47333
#> neval
#> 1 10
#> 2 10
Expand All @@ -242,9 +239,9 @@ summary(benchmark_complete_02, unit = "ms")

``` r
summary(benchmark_complete_02, unit = "relative")
#> expr min lq mean median uq max neval
#> 1 MC 1.000 1.000 1.000 1.000 1.000 1.000 10
#> 2 NB 1152.005 1151.414 1077.567 1113.477 1010.025 991.945 10
#> expr min lq mean median uq max neval
#> 1 MC 1.0000 1.000 1.0000 1.0000 1.0000 1.0000 10
#> 2 NB 874.2891 850.459 762.5925 799.3274 697.0987 667.8871 10
```

## Plot
Expand Down
Loading

0 comments on commit c1a1681

Please sign in to comment.