Report correlations, regressions and summariesFunctions to create publication-ready tables for common analysis tasks |
|
---|---|
Create a summary table for categorical variables and their relationship with a continuous outcome variable |
|
Create a correlation table with summary statistics in APA style |
|
Create a summary table comparing standardized and non-standardized linear models |
|
Create a summary table comparing standardized and non-standardized proportional odd logistic regression models |
|
Calculate correlation matricesIt can be surprisingly difficult to calculate correlation matrices, particularly when data is weighted or incomplete. These functions help and prepare data for |
|
Calculate correlation matrix with significance tests and descriptives |
|
Create a (weighted) correlation matrix from multiply imputed data |
|
Create a correlation matrix from multiply imputed data with weights |
|
Calculates a partial correlation matrix controlling for one or more variables |
|
Create a correlation matrix from survey data with summary statistics |
|
Tidy a correlation matrix |
|
Tidy a survey-weighted correlation matrix |
|
Formatters and reporting helpersFunctions to format numbers for statistical reporting and other helpers for statistical reporting |
|
Format confidence interval based on the bounds |
|
Format number as correlation coefficient |
|
Format p-value in line with APA standard (no leading 0) |
|
Format fraction as percentage string |
|
Round function that returns trailing zeroes |
|
Round all numeric columns in dataframe |
|
Significance stars for p-values |
|
Get letters to indicate results of multiple comparisons/post-hoc tests |
|
Report (model comparison) ANOVA tests |
|
Rename variables and/or their levels |
|
Get code to generate tibbles to rename categorical variables and their levels |
|
Get code to rename model coefficients in summary tables |
|
Calculate share of NA-values in vector |
|
Cut a continuous variable into given proportions |
|
Helper function to style gt-table in APA style |
|
Add plots into gt table column |
|
Create distribution charts to show in descriptive table |
|
Tidy a correlation matrix |
|
Tidy multiple imputation models created with |
|
Tidy a survey-weighted correlation matrix |
|
Helper function to enable tidiers to be used on standardized models |
|
Glance a multiple imputation |
|
Run and plot mediation modelsMediation models can be estimated with lavaan. These functions offer a simple interface and an integrated path from modeling to visualisation |
|
Conduct (parallel) mediation analysis |
|
Plot mediation model with one or more mediators |
|
Plot a moderated mediation model |
|
Make and assess scalesPsychologists often use multiple items to measure a construct. These functions create scale scores and assess reliability (internal consistency) |
|
Create a scale by calculating item mean and returns descriptives |
|
Create multiple scales by calculating item means and return descriptives |
|
Create a scale based on multiple imputation at item level |
|
Calculate Spearman-Brown reliability for two-item scale |
|
Statistical testsSome functions to facilitate running common tests with less common requirements |
|
lm() with standardised continuous variables |
|
polr() with standardised continuous variables |
|
t-test() on multiply-imputed data (accepts survey weights) |
|
Paired t.test with Cohen's d |
|
Pairwise t-tests() returned in tidy dataframe |
|
Pairwise t.tests with effect sizes and survey weights |
|
Pairwise t-tests() on multiply-imputed data (accepts survey weights) |
|
Report F-test for significance of multiply imputed lm models |
|
Survey functionsFunctions to work with survey data |
|
t.test for survey object with Cohen's d |
|
Create a correlation matrix from survey data with summary statistics |
|
Create scale by calculating item mean and returns descriptives for srvyr objects |
|
Create overview over missing data in survey object |
|
Pairwise t.tests with effect sizes and survey weights |
|
Demo datasets |
|
Sample data: health data from the European Social Survey Wave 7 |
|
Sample data: World Values Survey |
|
Workflow functionsMiscellaneous functions that can improve your workflow, from setting up structured analysis projects to using the clipboard |
|
Set up analysis project folder and script files |
|
Copy data to clipboard to paste into Excel |
|
Dump objects to clipboard (to transfer them between R sessions) |
|
Run a code snippet and copy formatted code and output to clipboard |
|
Convert a tibble/dataframe to tribble code |
|
Turn line of items separated by whitespace into vector or code for c() |
|
Save ggplot-graph and show in folder |
|
Dummy-code variable |
|
Set variable to NA when it has specific values |
|
Set variable to NA based on conditions |
|
Miscellaneous |
|
Functions to Accelerate (Academic) Data Analysis and Reporting |
|
Knitr S3 method to print tables |
|
Renders HTML code for Viewer pane |
|
Paste arguments while ignoring NAs |