Learn R Programming

⚠️There's a newer version (0.6.1) of this package.Take me there.

Efficient and Publishing-Oriented Workflow for Psychological Science

psycho

Namepsycho
Stable
Documentation
Blog
Examples
Questions
Authors
Reference

:warning: NOTE: This package is being deprecated in favour of the report package. Please check it out and ask for any missing features.


Goal

The main goal of the psycho package is to provide tools for psychologists, neuropsychologists and neuroscientists, to facilitate and speed up the time spent on data analysis. It aims at supporting best practices by providing tools to format the output of statistical methods to directly paste them into a manuscript, ensuring standardization of statistical reporting.

Contribute

psycho is a young package in need of affection. You can easily hop aboard the developpment of this open-source software and improve psychological science:

  • Need some help? Found a bug? Request a new feature? Just open an issue :relaxed:
  • Want to add a feature? Correct a bug? You're more than welcome to contribute!

Don't be shy, try to code and submit a pull request (PR). Even if unperfect, we will help you to make a great PR! All contributors will be very graciously rewarded. Someday.

Examples

Check examples in the following vignettes:

Or blog posts:

General Workflow

The package revolves around the psychobject. Main functions from the package return this type, and the analyze() function transforms other R objects into psychobjects. Four functions can then be applied on a psychobject: summary(), print(), plot() and values().

Installation

  • To get the stable version from CRAN, run the following commands in your R console:
install.packages("psycho")
library("psycho")
  • To get the latest development version, run the following:
install.packages("devtools")
library("devtools")
install_github("neuropsychology/psycho.R")
library("psycho")

Credits

You can cite the package as following:

  • Makowski, (2018). The psycho Package: an Efficient and Publishing-Oriented Workflow for Psychological Science. Journal of Open Source Software, 3(22), 470. https://doi.org/10.21105/joss.00470

Please remember that psycho is a high-level package that heavily relies on many other packages, such as tidyverse, psych, qgraph, rstanarm, lme4 and others (See Description for the full list of dependencies). Please cite their authors ;)

Contributors

Copy Link

Version

Install

install.packages('psycho')

Monthly Downloads

1,528

Version

0.4.91

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Dominique Makowski

Last Published

June 19th, 2019

Functions in psycho (0.4.91)

analyze.lm

Analyze lm objects.
analyze.lmerModLmerTest

Analyze lmerModLmerTest objects.
format_loadings

Format the loadings of a factor analysis.
analyze.principal

Analyze fa objects.
create_intervals

Overlap of Two Empirical Distributions.
dprime

Dprime and Other Signal Detection Theory indices.
find_distance_cluster

Find the distance of a point with its kmean cluster.
get_R2.stanreg

R2 or Bayesian Models.
find_combinations.formula

Generate all combinations of predictors of a formula.
format_formula

Clean and format formula.
analyze.blavaan

Analyze blavaan (SEM or CFA) objects.
bayes_cor.test

Performs a Bayesian correlation.
find_matching_string

Fuzzy string matching.
format_string

Tidyverse-friendly sprintf.
as.data.frame.density

Coerce to a Data Frame.
bayes_cor

Bayesian Correlation Matrix.
analyze.stanreg

Analyze stanreg objects.
assess

Compare a patient's score to a control group
find_highest_density_point

Find the Highest Density Point.
format_p

Format p values.
crawford.test.freq

Crawford-Howell (1998) frequentist t-test for single-case analysis.
R2_LOO_Adjusted

Compute LOO-adjusted R2.
analyze.glmerMod

Analyze glmerMod objects.
find_best_model.stanreg

Returns the best combination of predictors based on LOO cross-validation indices.
get_info.lm

Get information about models.
find_random_effects

Find random effects in formula.
find_combinations

Generate all combinations.
get_info.lmerModLmerTest

Get information about models.
cite_packages

Citations of loaded packages.
find_season

Find season of dates.
analyze.fa

Analyze fa objects.
analyze.glm

Analyze glm objects.
interpret_R2

R2 interpreation.
analyze.htest

Analyze htest (correlation, t-test...) objects.
format_bf

Bayes factor formatting
crawford_dissociation.test

Crawford-Howell (1998) modified t-test for testing difference between a patient<U+00E2><U+20AC><U+2122>s performance on two tasks.
correlation

Multiple Correlations.
crawford.test

Crawford-Garthwaite (2007) Bayesian test for single-case analysis.
find_best_model.lmerModLmerTest

Returns the best combination of predictors for lmerTest objects.
find_best_model.lavaan

Returns all combinations of lavaan models with their indices of fit.
get_contrasts.glmerMod

Compute estimated contrasts from models.
get_graph.psychobject_correlation

Get graph data from correlation.
get_contrasts.lm

Compute estimated contrasts from models.
interpret_R2_posterior

R2 interpreation for a posterior distribution.
get_contrasts

Compute estimated contrasts from models.
emotion

Emotional Ratings of Pictures
find_best_model

Returns the best model.
get_R2.glm

Pseudo-R-squared for Logistic Models.
get_R2

Get Indices of Explanatory Power.
get_R2.lm

R2 and adjusted R2 for Linear Models.
get_R2.merMod

R2 and adjusted R2 for GLMMs.
get_contrasts.stanreg

Compute estimated contrasts from models.
get_cfa_model

Get CFA model.
get_data

Extract the dataframe used in a model.
get_info

Get information about objects.
get_predicted.stanreg

Compute predicted values of stanreg models.
mpe

Compute Maximum Probability of Effect (MPE).
n_factors

Find Optimal Factor Number.
print.psychobject

Print the results.
simulate_data_regression

Simulates data for single or multiple regression.
summary.psychobject

Print the results.
rope

Region of Practical Equivalence (ROPE)
power_analysis

Power analysis for fitted models.
values

Extract values as list.
interpret_d_posterior

Standardized difference (Cohen's d) interpreation for a posterior distribution.
interpret_d

Standardized difference (Cohen's d) interpreation.
plot.psychobject

Plot the results.
get_contrasts.glm

Compute estimated contrasts from models.
get_contrasts.lmerModLmerTest

Compute estimated contrasts from models.
get_contrasts.lmerMod

Compute estimated contrasts from models.
format_digit

Formatting
get_predicted

Compute predicted values from models.
get_predicted.glm

Compute predicted values of lm models.
interpret_RMSEA

RMSEA interpreation.
interpret_bf

Bayes Factor Interpretation
interpret_odds_posterior

Odds ratio interpreation for a posterior distribution.
golden

Golden Ratio.
get_graph.fa

Get graph data from factor analysis.
get_predicted.lm

Compute predicted values of lm models.
interpret_lavaan.lavaan

Interpret fit measures of lavaan objects
get_graph.lavaan

Get graph data from lavaan or blavaan objects.
get_predicted.merMod

Compute predicted values of lm models.
interpret_odds

Odds ratio interpreation for a posterior distribution.
interpret_r

Correlation coefficient r interpreation.
interpret_omega_sq

Omega Squared Interpretation
mellenbergh.test

Mellenbergh & van den Brink (1998) test for pre-post comparison.
plot_loadings

Plot loadings.
model_to_priors

Model to Prior.
get_loadings_max

Get loadings max.
get_formula

Get formula of models.
get_graph

Get graph data.
interpret_lavaan.blavaan

Interpret fit measures of blavaan objects
interpret_lavaan

Interpret fit measures of lavaan or blavaan objects
get_means

Compute estimated means from models.
is.psychobject

Creates or tests for objects of mode "psychobject".
interpret_r_posterior

Correlation coefficient r interpreation for a posterior distribution.
is.standardized

Check if a dataframe is standardized.
reorder_matrix

Reorder square matrix.
refdata

Create a reference grid.
is.mixed

Check if model includes random effects.
overlap

Overlap of Two Empirical Distributions.
probs_to_odds

Convert probabilities to (log)odds.
omega_sq

Partial Omega Squared.
is.mixed.stanreg

Check if model includes random effects.
odds_to_d

(Log) odds ratio to Cohen's d
standardize.numeric

Standardize (scale and reduce) numeric variables.
odds_to_probs

Convert (log)odds to probabilies.
rnorm_perfect

Perfect Normal Distribution.
remove_empty_cols

Remove empty columns.
remove_outliers

Remove outliers.
percentile

Transform z score to percentile.
standardize.stanreg

Standardize Posteriors.
percentile_to_z

Transform a percentile to a z score.
standardize.lm

Standardize Coefficients.
standardize

Standardize.
standardize.data.frame

Standardize (scale and reduce) Dataframe.
standardize.glm

Standardize Coefficients.
HDImin

Highest Density Intervals (HDI)
HDImax

Highest Density Intervals (HDI)
affective

Data from the Affective Style Questionnaire (ASQ - French Validation)
analyze.aov

Analyze aov and anova objects
analyze

Analyze objects.
HDI

Highest Density Intervals (HDI).
R2_nakagawa

Pseudo-R-squared for Generalized Mixed-Effect models.
R2_tjur

Tjur's (2009) coefficient of determination.
analyze.lavaan

Analyze lavaan SEM or CFA) objects.