-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Files changed: A .Rbuildignore A .github/linters/.lintr A .setup/build/cTMed.pdf A .setup/build/cTMed_0.0.0.9000.tar.gz M .setup/cpp/cTMed-direct-vec.cpp M .setup/cpp/cTMed-direct.cpp M .setup/cpp/cTMed-indirect-vec.cpp M .setup/cpp/cTMed-indirect.cpp M .setup/cpp/cTMed-mc-med.cpp M .setup/cpp/cTMed-mc-phi-i.cpp M .setup/cpp/cTMed-mc-phi.cpp M .setup/cpp/cTMed-med-s.cpp M .setup/cpp/cTMed-med-vec.cpp M .setup/cpp/cTMed-med.cpp A .setup/data-raw/deboeck2015.Rds A .setup/data-raw/deboeck2015_na.Rds A .setup/data-raw/deboeck2015_ou_ctsem.Rds A .setup/data-raw/deboeck2015_ou_dynr.Rds A .setup/data-raw/deboeck2015_ssm.Rds A .setup/data-raw/deboeck2015phi.Rds A .setup/data-raw/delta.Rds A .setup/data-raw/mc.Rds A .setup/data-raw/posterior.Rds A .setup/latex/bib/quarto.bib A .setup/lint/.lintr A CITATION.cff M DESCRIPTION A LICENSE A LICENSE.md A NAMESPACE A R/RcppExports.R A R/nBootstrap-ci-format-dot.R A R/nBootstrap-pc-ci-dot.R A R/nBootstrap-pc-probs-dot.R A R/wald-ci-wald-dot.R A R/wald-probs-of-alpha-dot.R A README.md M data/deboeck2015.rda M data/deboeck2015phi.rda A man/DeltaMed.Rd A man/Direct.Rd A man/Indirect.Rd A man/MCMed.Rd A man/MCPhi.Rd A man/Med.Rd A man/PosteriorMed.Rd A man/TestPhi.Rd A man/TestStable.Rd A man/Total.Rd A man/cTMed-package.Rd A man/confint.ctmeddelta.Rd A man/confint.ctmedmc.Rd A man/deboeck2015.Rd A man/deboeck2015phi.Rd A man/plot.ctmeddelta.Rd A man/plot.ctmedmc.Rd A man/plot.ctmedmed.Rd A man/print.ctmeddelta.Rd A man/print.ctmedeffect.Rd A man/print.ctmedmc.Rd A man/print.ctmedmcphi.Rd A man/print.ctmedmed.Rd A man/summary.ctmeddelta.Rd A man/summary.ctmedmc.Rd A man/summary.ctmedmed.Rd M project.Rproj A src/Makevars A src/Makevars.win A src/RcppExports.cpp A src/source.cpp A vignettes/data.Rmd A vignettes/delta.Rmd A vignettes/fig-vignettes-data-error-1.png A vignettes/fig-vignettes-data-error-2.png A vignettes/fig-vignettes-data-error-3.png A vignettes/fig-vignettes-data-no-error-1.png A vignettes/fig-vignettes-data-no-error-2.png A vignettes/fig-vignettes-data-no-error-3.png A vignettes/fig-vignettes-delta-ctsem-delta-1.png A vignettes/fig-vignettes-delta-ctsem-delta-2-1.png A vignettes/fig-vignettes-delta-ctsem-delta-2-2.png A vignettes/fig-vignettes-delta-ctsem-delta-2-3.png A vignettes/fig-vignettes-delta-ctsem-delta-2.png A vignettes/fig-vignettes-delta-ctsem-delta-3.png A vignettes/fig-vignettes-delta-ctsem-med-1.png A vignettes/fig-vignettes-delta-dynr-delta-1.png A vignettes/fig-vignettes-delta-dynr-delta-2.png A vignettes/fig-vignettes-delta-dynr-delta-3.png A vignettes/fig-vignettes-delta-dynr-med-1.png A vignettes/fig-vignettes-mc-ctsem-mc-1.png A vignettes/fig-vignettes-mc-ctsem-mc-2-1.png A vignettes/fig-vignettes-mc-ctsem-mc-2-2.png A vignettes/fig-vignettes-mc-ctsem-mc-2-3.png A vignettes/fig-vignettes-mc-ctsem-mc-2.png A vignettes/fig-vignettes-mc-ctsem-mc-3.png A vignettes/fig-vignettes-mc-ctsem-med-1.png A vignettes/fig-vignettes-mc-ctsem-posterior-1.png A vignettes/fig-vignettes-mc-ctsem-posterior-2-1.png A vignettes/fig-vignettes-mc-ctsem-posterior-2-2.png A vignettes/fig-vignettes-mc-ctsem-posterior-2-3.png A vignettes/fig-vignettes-mc-ctsem-posterior-2.png A vignettes/fig-vignettes-mc-ctsem-posterior-3.png A vignettes/fig-vignettes-mc-dynr-mc-1.png A vignettes/fig-vignettes-mc-dynr-mc-2.png A vignettes/fig-vignettes-mc-dynr-mc-3.png A vignettes/fig-vignettes-mc-dynr-med-1.png A vignettes/fig-vignettes-ou-model-1.png A vignettes/mc.Rmd A vignettes/ou.Rmd A vignettes/vignettes.bib
- Loading branch information
1 parent
1694df0
commit 1984049
Showing
110 changed files
with
9,664 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.*\.Rcheck$ | ||
.*\.Rproj$ | ||
^CITATION\.cff$ | ||
^LICENSE\.md$ | ||
^Makefile$ | ||
^README\.Rmd$ | ||
^README\.md$ | ||
^\.Rproj\.user$ | ||
^\.devcontainer$ | ||
^\.git.*$ | ||
^\.library$ | ||
^\.setup$ | ||
^\.sim$ | ||
^detritus$ | ||
^index\.qmd$ | ||
^pkgdown$ | ||
^quarto$ | ||
^scripts$ | ||
^vignettes$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters: lintr::linters_with_defaults(lintr::object_name_linter(styles = c("CamelCase", "snake_case", "symbols"))) | ||
exclusions: list("R/RcppExports.R", "R/methods.R") | ||
exclude: "# Exclude Linting" | ||
exclude_start: "# Begin Exclude Linting" | ||
exclude_end: "# End Exclude Linting" | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@Article{Wright-1918, | ||
author = {Sewall Wright}, | ||
date = {1918-07}, | ||
journaltitle = {Genetics}, | ||
title = {On the nature of size factors}, | ||
doi = {10.1093/genetics/3.4.367}, | ||
number = {4}, | ||
pages = {367--374}, | ||
volume = {3}, | ||
publisher = {Oxford University Press ({OUP})}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters: lintr::linters_with_defaults(lintr::object_name_linter(styles = c("CamelCase", "snake_case", "symbols"))) | ||
exclusions: list("R/RcppExports.R", "R/methods.R") | ||
exclude: "# Exclude Linting" | ||
exclude_start: "# Begin Exclude Linting" | ||
exclude_end: "# End Exclude Linting" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# ----------------------------------------------------------- | ||
# CITATION file created with {cffr} R package, v1.0.0 | ||
# See also: https://docs.ropensci.org/cffr/ | ||
# ----------------------------------------------------------- | ||
|
||
cff-version: 1.2.0 | ||
message: 'To cite package "cTMed" in publications use:' | ||
type: software | ||
license: MIT | ||
title: 'cTMed: Continuous Time Mediation' | ||
version: 0.0.0.9000 | ||
abstract: Calculates standard errors and confidence intervals for the indirect effect | ||
in continuous time mediation models. | ||
authors: | ||
- family-names: Pesigan | ||
given-names: Ivan Jacob Agaloos | ||
email: [email protected] | ||
orcid: https://orcid.org/0000-0003-4818-8420 | ||
preferred-citation: | ||
type: manual | ||
title: 'cTMed: Continuous Time Mediation' | ||
authors: | ||
- family-names: Pesigan | ||
given-names: Ivan Jacob Agaloos | ||
email: [email protected] | ||
orcid: https://orcid.org/0000-0003-4818-8420 | ||
year: '2024' | ||
notes: R package version 0.0.0.9000 | ||
repository-code: https://github.com/jeksterslab/cTMed | ||
url: https://jeksterslab.github.io/cTMed/ | ||
contact: | ||
- family-names: Pesigan | ||
given-names: Ivan Jacob Agaloos | ||
email: [email protected] | ||
orcid: https://orcid.org/0000-0003-4818-8420 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ Suggests: | |
testthat, | ||
simStateSpace, | ||
expm | ||
RoxygenNote: 7.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YEAR: 2023 | ||
COPYRIGHT HOLDER: Ivan Jacob Agaloos Pesigan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) 2023 Ivan Jacob Agaloos Pesigan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
S3method(confint,ctmeddelta) | ||
S3method(confint,ctmedmc) | ||
S3method(plot,ctmeddelta) | ||
S3method(plot,ctmedmc) | ||
S3method(plot,ctmedmed) | ||
S3method(print,ctmeddelta) | ||
S3method(print,ctmedeffect) | ||
S3method(print,ctmedmc) | ||
S3method(print,ctmedmcphi) | ||
S3method(print,ctmedmed) | ||
S3method(summary,ctmeddelta) | ||
S3method(summary,ctmedmc) | ||
S3method(summary,ctmedmed) | ||
export(DeltaMed) | ||
export(Direct) | ||
export(Indirect) | ||
export(MCMed) | ||
export(MCPhi) | ||
export(Med) | ||
export(PosteriorMed) | ||
export(TestPhi) | ||
export(TestStable) | ||
export(Total) | ||
importFrom(Rcpp,sourceCpp) | ||
useDynLib(cTMed, .registration = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
.DirectVec <- function(phi_vec, delta_t, from, to, med) { | ||
.Call(`_cTMed_DirectVec`, phi_vec, delta_t, from, to, med) | ||
} | ||
|
||
.Direct <- function(phi, delta_t, from, to, med) { | ||
.Call(`_cTMed_Direct`, phi, delta_t, from, to, med) | ||
} | ||
|
||
.IndirectVec <- function(phi_vec, delta_t, from, to, med) { | ||
.Call(`_cTMed_IndirectVec`, phi_vec, delta_t, from, to, med) | ||
} | ||
|
||
.Indirect <- function(phi, delta_t, from, to, med) { | ||
.Call(`_cTMed_Indirect`, phi, delta_t, from, to, med) | ||
} | ||
|
||
.MCMed <- function(phi, vcov_phi_vec_l, delta_t, from, to, med, R, test_phi = TRUE) { | ||
.Call(`_cTMed_MCMed`, phi, vcov_phi_vec_l, delta_t, from, to, med, R, test_phi) | ||
} | ||
|
||
.MCPhiI <- function(phi, vcov_phi_vec_l, test_phi = TRUE) { | ||
.Call(`_cTMed_MCPhiI`, phi, vcov_phi_vec_l, test_phi) | ||
} | ||
|
||
.MCPhi <- function(phi, vcov_phi_vec_l, R, test_phi = TRUE) { | ||
.Call(`_cTMed_MCPhi`, phi, vcov_phi_vec_l, R, test_phi) | ||
} | ||
|
||
.Meds <- function(phi, delta_t, from, to, med) { | ||
.Call(`_cTMed_Meds`, phi, delta_t, from, to, med) | ||
} | ||
|
||
.MedVec <- function(phi_vec, delta_t, from, to, med) { | ||
.Call(`_cTMed_MedVec`, phi_vec, delta_t, from, to, med) | ||
} | ||
|
||
.Med <- function(phi, delta_t, from, to, med) { | ||
.Call(`_cTMed_Med`, phi, delta_t, from, to, med) | ||
} | ||
|
||
#' Test the Drift Matrix | ||
#' | ||
#' Both have to be true for the function to return `TRUE`. | ||
#' - Test that the real part of all eigenvalues of \eqn{\boldsymbol{\Phi}} | ||
#' is less than zero. | ||
#' - Test that the diagonal values of \eqn{\boldsymbol{\Phi}} | ||
#' are between 0 to negative inifinity. | ||
#' | ||
#' @author Ivan Jacob Agaloos Pesigan | ||
#' | ||
#' @param phi Numeric matrix. | ||
#' The drift matrix (\eqn{\boldsymbol{\Phi}}). | ||
#' | ||
#' @examples | ||
#' phi <- matrix( | ||
#' data = c( | ||
#' -0.357, 0.771, -0.450, | ||
#' 0.0, -0.511, 0.729, | ||
#' 0, 0, -0.693 | ||
#' ), | ||
#' nrow = 3 | ||
#' ) | ||
#' colnames(phi) <- rownames(phi) <- c("x", "m", "y") | ||
#' TestPhi(phi = phi) | ||
#' phi <- matrix( | ||
#' data = c( | ||
#' -6, 5.5, 0, 0, | ||
#' 1.25, -2.5, 5.9, -7.3, | ||
#' 0, 0, -6, 2.5, | ||
#' 5, 0, 0, -6 | ||
#' ), | ||
#' nrow = 4 | ||
#' ) | ||
#' colnames(phi) <- rownames(phi) <- paste0("y", 1:4) | ||
#' TestPhi(phi = phi) | ||
#' | ||
#' @family Continuous Time Mediation Functions | ||
#' @keywords cTMed test | ||
#' @export | ||
TestPhi <- function(phi) { | ||
.Call(`_cTMed_TestPhi`, phi) | ||
} | ||
|
||
#' Test Stability | ||
#' | ||
#' The function computes the eigenvalues of the input matrix `x`. | ||
#' It checks if the real part of all eigenvalues is negative. | ||
#' If all eigenvalues have negative real parts, | ||
#' the system is considered stable. | ||
#' | ||
#' @author Ivan Jacob Agaloos Pesigan | ||
#' | ||
#' @param x Numeric matrix. | ||
#' | ||
#' @examples | ||
#' x <- matrix( | ||
#' data = c( | ||
#' -0.357, 0.771, -0.450, | ||
#' 0.0, -0.511, 0.729, | ||
#' 0, 0, -0.693 | ||
#' ), | ||
#' nrow = 3 | ||
#' ) | ||
#' TestStable(x) | ||
#' x <- matrix( | ||
#' data = c( | ||
#' -6, 5.5, 0, 0, | ||
#' 1.25, -2.5, 5.9, -7.3, | ||
#' 0, 0, -6, 2.5, | ||
#' 5, 0, 0, -6 | ||
#' ), | ||
#' nrow = 4 | ||
#' ) | ||
#' TestStable(x) | ||
#' | ||
#' @family Continuous Time Mediation Functions | ||
#' @keywords cTMed test | ||
#' @export | ||
TestStable <- function(x) { | ||
.Call(`_cTMed_TestStable`, x) | ||
} | ||
|
||
.TotalVec <- function(phi_vec, delta_t) { | ||
.Call(`_cTMed_TotalVec`, phi_vec, delta_t) | ||
} | ||
|
||
.Total <- function(phi, delta_t) { | ||
.Call(`_cTMed_Total`, phi, delta_t) | ||
} | ||
|
Oops, something went wrong.