Skip to content

Commit

Permalink
shapiro test changed in MANOVA (#306)
Browse files Browse the repository at this point in the history
* shapiro test changed in MANOVA

* also update bivariate normality

* logregression footnote only for enter
  • Loading branch information
JohnnyDoorn authored May 7, 2024
1 parent 0ea8cb3 commit 9d0e651
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 4 additions & 2 deletions R/regressionlogistic.R
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ RegressionLogisticInternal <- function(jaspResults, dataset = NULL, options, ...
rows <- vector("list", length(glmObj))

for (midx in seq_along(glmObj)) {
.linregAddPredictorsInModelFootnote(jaspResults[["modelSummary"]],
options[["modelTerms"]][[midx]][["components"]], midx)

if (options$method == "enter")
.linregAddPredictorsInModelFootnote(jaspResults[["modelSummary"]],
options[["modelTerms"]][[midx]][["components"]], midx)
mObj <- glmObj[[midx]]
if (midx > 1) {
if (options$method == "forward" ||
Expand Down
3 changes: 2 additions & 1 deletion inst/help/Correlation.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The Correlation analysis allows estimation of the population correlation, as wel
#### Assumption checks

- Multivariate normality
- Shapiro: Computes the Shapiro-Wilk statistic to test the null hypothesis that the selected variables have multivariate normal distribution.
- Shapiro: Generalized Shapiro-Wilk test for multivariate normality by Villasenor-Alva and Gonzalez-Estrada (2009), using the mvShapiroTest package.

- Pairwise normality
- Shapiro: For each possible combination of the selected variables, computes the Shapiro-Wilk statistic to test the null hypothesis that the variable pair has a bivariate normal distribution.
Expand Down Expand Up @@ -108,6 +108,7 @@ The Correlation analysis allows estimation of the population correlation, as wel
- Whitlock, M. C., & Schluter, D. (2015). *The analysis of biological data (2nd ed.)*. Greenwood Village, Colorado: Roberts and Company Publishers.
- Sellke, T., Bayarri, M. J., & Berger, J. O. (2001). Calibration of *p* values for testing precise null hypotheses. *The American Statistician, 55*(1), 62-71.
- Caruso, J.C., & Cliff, N. (1997). Empirical Size, Coverage, and Power of Confidence Intervals for Spearman's Rho. *Educational and Psychological Measurement, 57*(4), 637-654.
- Villasenor-Alva, J.A. and Gonzalez-Estrada, E. (2009). A generalization of Shapiro-Wilk's test for multivariate normality. *Communications in Statistics: Theory and Methods*, 38, 1870-1883.
- Xu, W., Hou, Y., Hung, Y.S., & Zou, Y. (2013). A comparative analysis of Spearman’s rho and Kendall’s tau in normal and contaminated normal models. *Signal Processing, 93*, 261-276.

### R Packages
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/test-correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ results <- jaspTools::runAnalysis("Correlation", "debug.csv", options)
test_that("Shapiro-Wilk Test for Multivariate Normality table results match", {
table <- results[["results"]][["assumptionsContainer"]][["collection"]][["assumptionsContainer_multivariateShapiro"]][["data"]]
jaspTools::expect_equal_tables(table,
list(0.878989128563944, 6.30818027438384e-06))
list(0.951937236443559, 1.26292374637229e-05))
})

test_that("Shapiro-Wilk Test for Bivariate Normality table results match", {
table <- results[["results"]][["assumptionsContainer"]][["collection"]][["assumptionsContainer_pairwiseShapiro"]][["data"]]
jaspTools::expect_equal_tables(table,
list(0.901474720121716, 1.65965808553626e-06, "-", "contNormal", "contGamma",
0.966220519133756, 0.0114432512312019, "-", "contNormal", "contcor1",
0.966282842281815, 0.0561697740909883, "-", "contNormal", "debMiss30",
0.873628887299087, 9.84839266547295e-08, "-", "contGamma", "contcor1",
0.862918050703853, 1.7604538483754e-06, "-", "contGamma", "debMiss30",
0.990143883746405, 0.861444767503725, "-", "contcor1", "debMiss30"
))
list(0.920133622718739, 9.26266088028011e-09, "-", "contNormal", "contGamma",
0.975095766862836, 0.0197633225756002, "-", "contNormal", "contcor1",
0.97421223116433, 0.108462090826961, "-", "contNormal", "debMiss30",
0.930015026431291, 8.89751236523928e-08, "-", "contGamma", "contcor1",
0.933648725575745, 2.37704417812631e-05, "-", "contGamma", "debMiss30",
0.98166946114741, 0.416182497522526, "-", "contcor1", "debMiss30"
))
})

test_that("Correlation plot matches", {
Expand Down

0 comments on commit 9d0e651

Please sign in to comment.