-
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/betaMC.pdf A .setup/build/betaMC_1.3.1.tar.gz A .setup/data-raw/benchmark.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/betaSandwich-acov-hc-dot.R A R/betaSandwich-acov-sem-inverse-dot.R A R/betaSandwich-cov-hc-dot.R A R/betaSandwich-gamma-hc-dot.R A R/betaSandwich-q-mat-dot.R A R/dataSets-nas1982.R A R/gammaADF-gamma-adf-consistent-dot.R A R/gammaADF-gamma-adf-unbiased-dot.R A R/gammaN-gamma-mvn-dot.R A R/linearAlgebra-d-mat-dot.R A R/linearAlgebra-d-of-mat-dot.R A R/linearAlgebra-pinv-of-d-mat-dot.R A R/linearAlgebra-positive-definite-2-test-dot.R A R/linearAlgebra-positive-definite-test-dot.R A R/linearAlgebra-sym-of-vech-dot.R A R/linearAlgebra-vec-dot.R A R/linearAlgebra-vech-dot.R A R/linearAlgebra-vech-names-dot.R A R/miHelper-ariv-dot.R A R/miHelper-mi-combine-dot.R A R/miHelper-total-adj-dot.R A R/nBootstrap-ci-format-dot.R A R/nBootstrap-pc-ci-dot.R A R/nBootstrap-pc-probs-dot.R A R/processLM-dif-dot.R A R/processLM-process-lm-dot.R A R/randomGaussian-location-dot.R A R/randomGaussian-random-gaussian-chol-dot.R A R/randomGaussian-random-gaussian-eigen-dot.R A R/randomGaussian-random-gaussian-svd-dot.R A R/randomGaussian-random-gaussian-z-dot.R A R/rhoMatrix-rho-of-sigma-dot.R A R/semmcci-theta-hat-star-dot.R A R/strRegression-beta-star-dot.R A R/strRegression-beta-star-of-rho-dot.R A R/strRegression-jacobian-vech-sigma-wrt-theta-dot.R A R/strRegression-moments-index-dot.R A R/strRegression-p-cor-sq-dot.R A R/strRegression-r-sq-bar-dot.R A R/strRegression-r-sq-of-sigma-dot.R A R/strRegression-s-p-cor-dot.R A R/strRegression-sigma-y-sq-dot.R A R/strRegression-sigma-yx-dot.R A R/strRegression-theta-index-dot.R A README.md M data/nas1982.rda A man/BetaMC.Rd A man/DeltaRSqMC.Rd A man/DiffBetaMC.Rd A man/MC.Rd A man/MCMI.Rd A man/PCorMC.Rd A man/RSqMC.Rd A man/SCorMC.Rd A man/betaMC-package.Rd A man/coef.betamc.Rd A man/confint.betamc.Rd A man/nas1982.Rd A man/print.betamc.Rd A man/print.mc.Rd A man/summary.betamc.Rd A man/summary.mc.Rd A man/vcov.betamc.Rd M project.Rproj A vignettes/benchmark.Rmd A vignettes/fig-vignettes-benchmark-unnamed-chunk-15-1.png A vignettes/vignettes.bib
- Loading branch information
1 parent
8a8a0f1
commit 422acc4
Showing
79 changed files
with
6,702 additions
and
0 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") | ||
exclude: "# Exclude Linting" | ||
exclude_start: "# Begin Exclude Linting" | ||
exclude_end: "# End Exclude Linting" | ||
|
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") | ||
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,56 @@ | ||
# ----------------------------------------------------------- | ||
# CITATION file created with {cffr} R package, v0.5.0 | ||
# See also: https://docs.ropensci.org/cffr/ | ||
# ----------------------------------------------------------- | ||
|
||
cff-version: 1.2.0 | ||
message: 'To cite package "betaMC" in publications use:' | ||
type: software | ||
license: MIT | ||
title: 'betaMC: Monte Carlo for Regression Effect Sizes' | ||
version: 1.3.1 | ||
doi: 10.3758/s13428-023-02114-4 | ||
abstract: Generates Monte Carlo confidence intervals for standardized regression coefficients | ||
(beta) and other effect sizes, including multiple correlation, semipartial correlations, | ||
improvement in R-squared, squared partial correlations, and differences in standardized | ||
regression coefficients, for models fitted by lm(). 'betaMC' combines ideas from | ||
Monte Carlo confidence intervals for the indirect effect (Pesigan and Cheung, 2023 | ||
<doi:10.3758/s13428-023-02114-4>) and the sampling covariance matrix of regression | ||
coefficients (Dudgeon, 2017 <doi:10.1007/s11336-017-9563-z>) to generate confidence | ||
intervals effect sizes in regression. | ||
authors: | ||
- family-names: Pesigan | ||
given-names: Ivan Jacob Agaloos | ||
email: r.jeksterslab@gmail.com | ||
orcid: https://orcid.org/0000-0003-4818-8420 | ||
preferred-citation: | ||
type: article | ||
title: Monte Carlo confidence intervals for the indirect effect with missing data | ||
authors: | ||
- family-names: Pesigan | ||
given-names: Ivan Jacob Agaloos | ||
email: r.jeksterslab@gmail.com | ||
orcid: https://orcid.org/0000-0003-4818-8420 | ||
- family-names: Cheung | ||
given-names: Shu Fai | ||
email: shufai.cheung@gmail.com | ||
orcid: https://orcid.org/0000-0002-9871-9448 | ||
year: '2023' | ||
doi: 10.3758/s13428-023-02114-4 | ||
journal: Behavior Research Methods | ||
notes: R package version 1.3.1 | ||
repository: https://packagemanager.rstudio.com/all/__linux__/jammy/latest/ | ||
repository-code: https://github.com/jeksterslab/betaMC | ||
url: https://jeksterslab.github.io/betaMC/ | ||
contact: | ||
- family-names: Pesigan | ||
given-names: Ivan Jacob Agaloos | ||
email: r.jeksterslab@gmail.com | ||
orcid: https://orcid.org/0000-0003-4818-8420 | ||
keywords: | ||
- confidence-intervals | ||
- monte-carlo | ||
- r | ||
- r-package | ||
- regression-effect-sizes | ||
- standardized-regression-coefficients |
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 |
---|---|---|
|
@@ -35,3 +35,4 @@ Suggests: | |
MASS, | ||
mice, | ||
Amelia | ||
RoxygenNote: 7.2.3 |
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,17 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
S3method(coef,betamc) | ||
S3method(confint,betamc) | ||
S3method(print,betamc) | ||
S3method(print,mc) | ||
S3method(summary,betamc) | ||
S3method(summary,mc) | ||
S3method(vcov,betamc) | ||
export(BetaMC) | ||
export(DeltaRSqMC) | ||
export(DiffBetaMC) | ||
export(MC) | ||
export(MCMI) | ||
export(PCorMC) | ||
export(RSqMC) | ||
export(SCorMC) |
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,33 @@ | ||
#' Asymptotic Covariance Matrix of the | ||
#' Standardized Parameter Vector | ||
#' | ||
#' @author Ivan Jacob Agaloos Pesigan | ||
#' | ||
#' @param jcap Numeric matrix. | ||
#' Jacobian matrix of the half-vectorization | ||
#' of the model-implied covariance matrix | ||
#' with respect to the standardized parameter vector. | ||
#' @param gammacap Numeric matrix. | ||
#' Adjusted asymptotic covariance matrix. | ||
#' @param gammacap_mvn Numeric matrix. | ||
#' Asymptotic covariance matrix of the sample covariance matrix | ||
#' assuming multivariate normal distribution. | ||
#' | ||
#' @family Beta Sandwich Functions | ||
#' @keywords betaSandwich acov internal | ||
#' @noRd | ||
.ACovHC <- function(jcap, | ||
gammacap, | ||
gammacap_mvn) { | ||
inversemvn <- chol2inv( | ||
chol(gammacap_mvn) | ||
) | ||
tjcapinversemvn <- t(jcap) %*% inversemvn | ||
bread <- chol2inv( | ||
chol(tjcapinversemvn %*% jcap) | ||
) | ||
meat <- tjcapinversemvn %*% gammacap %*% inversemvn %*% jcap | ||
return( | ||
bread %*% meat %*% bread | ||
) | ||
} |
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,23 @@ | ||
#' Inverse of The Asymptotic Covariance Matrix of the | ||
#' Standardized Parameter Vector | ||
#' | ||
#' @author Ivan Jacob Agaloos Pesigan | ||
#' | ||
#' @param jcap Numeric matrix. | ||
#' Jacobian matrix of the half-vectorization | ||
#' of the model-implied covariance matrix | ||
#' with respect to the standardized parameter vector. | ||
#' @param acov Numeric matrix. | ||
#' Asymptotic covariance matrix of the sample covariance matrix. | ||
#' | ||
#' @family Beta Sandwich Functions | ||
#' @keywords betaSandwich acov internal | ||
#' @noRd | ||
.ACovSEMInverse <- function(jcap, | ||
acov) { | ||
return( | ||
t(jcap) %*% chol2inv( | ||
chol(acov) | ||
) %*% jcap | ||
) | ||
} |
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,37 @@ | ||
#' Sampling Covariance Matrix of the Standardized Parameter Vector | ||
#' | ||
#' @author Ivan Jacob Agaloos Pesigan | ||
#' | ||
#' @param acov Numeric matrix. | ||
#' Asymptotic covariance matrix of the standardized parameter vector. | ||
#' @param type Character string. | ||
#' Correction type. | ||
#' Possible values are | ||
#' `"hc0"`, | ||
#' `"hc1"`, | ||
#' `"hc2"`, | ||
#' `"hc3"`, | ||
#' `"hc4"`, | ||
#' `"hc4m"`, and | ||
#' `"hc5"`. | ||
#' @param n Integer. | ||
#' Sample size. | ||
#' @param df Integer. | ||
#' Degrees of freedom. | ||
#' | ||
#' @family Beta Sandwich Functions | ||
#' @keywords betaSandwich cov internal | ||
#' @noRd | ||
.CovHC <- function(acov, | ||
type, | ||
n, | ||
df) { | ||
nstar <- ((n - 1)^2) / n | ||
out <- (1 / nstar) * acov | ||
if (type == "hc1") { | ||
out <- (n / df) * out | ||
} | ||
return( | ||
out | ||
) | ||
} |
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,40 @@ | ||
#' Asymptotic Covariance Matrix of the Sample Covariance Matrix | ||
#' | ||
#' @author Ivan Jacob Agaloos Pesigan | ||
#' | ||
#' @param d Numeric matrix. | ||
#' Centered data. | ||
#' @param sigmacap Numeric matrix. | ||
#' Covariance matrix of \eqn{Y, X_1, \dots, X_p}. | ||
#' @param qcap Numeric vector | ||
#' Leverage adjustment. | ||
#' @param n Integer. | ||
#' Sample size. | ||
#' | ||
#' @family BetaSandwich Functions | ||
#' @keywords betaSandwich gamma internal | ||
#' @noRd | ||
.GammaHC <- function(d, | ||
sigmacap, | ||
qcap, | ||
n) { | ||
return( | ||
( | ||
1 / n | ||
) * Reduce( | ||
f = "+", | ||
x = lapply( | ||
X = seq_len(n), | ||
FUN = function(i) { | ||
qcap[i] * tcrossprod( | ||
.Vech( | ||
tcrossprod( | ||
d[i, ] | ||
) - sigmacap | ||
) | ||
) | ||
} | ||
) | ||
) | ||
) | ||
} |
Oops, something went wrong.