unusualprofile

Calculates Conditional Mahalanobis Distances

https://github.com/wjschne/unusualprofile

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Calculates Conditional Mahalanobis Distances

Basic Info
Statistics
  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 7 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.md

unusualprofile

stable Codecov test
coverage CRAN
status <!-- badges: end -->

The goal of unusualprofile is to calculate conditional Mahalanobis distances and related statistics. Such statistics can help find cases that are unusual, even after controlling for specified predictors.

Installation

You can install the development version from GitHub with:

``` r

install.packages("remotes")

remotes::install_github("wjschne/unusualprofile") ```

Example

To use the unusualprofile package, one needs to know the correlations, means, and standard deviations among a set of continuous variables and at least one row of data from that set of variables.

Suppose we have set of variables that have the following relationships:

Multivariate normal model

First, we load the unusualprofile package.

r library(unusualprofile)

Included with the unusualprofile package, the d_example data set has a single row of data generated from the path diagram depicted above.

#>        X_1     X_2      X_3      Y_1        Y_2      Y_3        X        Y
#> 1 1.999498 1.44683 2.703249 1.664106 -0.8427126 1.811528 2.273441 1.201208

Also included with the unusualprofile package is the path diagram’s model-implied correlation matrix:

``` r R_example

> X1 X2 X3 Y1 Y2 Y3 X Y

> X_1 1.000 0.35 0.560 0.336 0.294 0.378 0.70 0.42

> X_2 0.350 1.00 0.400 0.240 0.210 0.270 0.50 0.30

> X_3 0.560 0.40 1.000 0.384 0.336 0.432 0.80 0.48

> Y_1 0.336 0.24 0.384 1.000 0.560 0.720 0.48 0.80

> Y_2 0.294 0.21 0.336 0.560 1.000 0.630 0.42 0.70

> Y_3 0.378 0.27 0.432 0.720 0.630 1.000 0.54 0.90

> X 0.700 0.50 0.800 0.480 0.420 0.540 1.00 0.60

> Y 0.420 0.30 0.480 0.800 0.700 0.900 0.60 1.00

```

Using the cond_maha function

We can specify the correlations (R), means (mu), standard deviations (sigma). independent variables (v_ind), and dependent variables (v_dep). In this case, the independent variables are composite scores summarizing the dependent variables.

``` r

Conditional Mahalanobis distance

cm <- condmaha(data = dexample, R = Rexample, mu = 0, sigma = 1, vindcomposites = c("X", "Y"), vdep = c("X1", "X2", "X3", "Y1", "Y2", "Y3"))

cm

> Conditional Mahalanobis Distance = 3.5167, df = 4, p = 0.9852

Plot

plot(cm) ```

Shiny App

A user-friendly app that performs the functions of the unusualprofile package is here.

Publication

An introduction to the applications of conditional distributions and Mahalanobis distances:

Schneider, W. J., & Ji, F. (2023). Detecting unusual score patterns in the context of relevant predictors. Journal of Pediatric Neuropsychology, 9, 1–17. https://doi.org/10.1007/s40817-022-00137-x

Owner

  • Name: W. Joel Schneider
  • Login: wjschne
  • Kind: user
  • Company: Temple University

Professor in School Psychology and Educational Leadership at Temple University

GitHub Events

Total
  • Watch event: 1
  • Push event: 7
Last Year
  • Watch event: 1
  • Push event: 7

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 56
  • Total Committers: 1
  • Avg Commits per committer: 56.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
W. Joel Schneider w****r@g****m 56

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 266 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: unusualprofile

Calculates Conditional Mahalanobis Distances

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 266 Last month
Rankings
Forks count: 21.9%
Stargazers count: 28.5%
Dependent packages count: 29.8%
Average: 35.2%
Dependent repos count: 35.5%
Downloads: 60.4%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.1 depends
  • dplyr * imports
  • ggnormalviolin * imports
  • ggplot2 * imports
  • magrittr * imports
  • purrr * imports
  • rlang * imports
  • stats * imports
  • tibble * imports
  • tidyr * imports
  • bookdown * suggests
  • covr * suggests
  • forcats * suggests
  • glue * suggests
  • kableExtra * suggests
  • knitr * suggests
  • lavaan * suggests
  • lifecycle * suggests
  • mvtnorm * suggests
  • patchwork * suggests
  • ragg * suggests
  • rmarkdown * suggests
  • roxygen2 * suggests
  • scales * suggests
  • simstandard >= 0.6.3 suggests
  • stringr * suggests
  • testthat * suggests