Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
 
 
man
 
 
 
 
 
 
 
 
 
 

LittleHelpers

Continuously updated collection of little helpers (tm) that facilitates my life in analyzing data (mostly comparative datasets) with R.

Use remotes::install_github("maksimrudnev/LittleHelpers") to install.

Overview

Multilevel helpers

Explore multilevel data:

  • cor_within prints and plots individual correlations within each group.
  • cor_between computes means and shows group-level correlation between two variables.
  • scatter_means_ci Computes means by group and plots on scatterplot against each other (shows country-level correlations).
  • graph_means_ci Plots means by group.
  • stacked_bar Computes proportions cross-table and plots them in a nice way, returns ggplot object, so any further +theme(), +scale_x(), etc. codes can be added.

Recode multilevel data:

  • aggr_and_merge helps to create group-level variables from individual-level variables and merge them back to the data.frame on the go.
  • grand_center Quick grand-mean centering.
  • group_center Quick group-mean centering.

Summarize and visualize multilevel regressions:

  • good_table Large function that creates customizable coefficients tables using multiple lmer models; outputs in Rstudio viewer.
  • potential_interactions Exploratory. If you have no idea what cross-level interactions to look for. Computes pairwise tests of all the possible interactions in the lmer() model, or simply shows correlations between random effects and group-level variables.
  • random_interaction Plots cross-level interactions for lmer()-fitted models. Customizable. Can automatically choose real moderator values close to mean+-(2)SD.
  • random_plot Plots random effects from lmer()-fitted models.
  • plef Quick interaction plot for simple models

Compute extra stats for multilevel regressions:

  • explained_variance.merMod Computes psudo-R-square for two-level regressions fitted with lmer().
  • vif_mer Compute variance inflation factor for multilevel regressions fitted with lmer().

Multigroup helpers

  • lavTestScore_clean Wrapper around lavaan::lavTestScore(), merging parameter labels with parameters and groups names and adding stars. Useful when you decide with between-group contraints might be relaxed.

  • mgcfa_diagnose Print comprehensible output to diagnose problems with MGCFA models.

  • mi_test Series of measurement invariance tests, analoigous to semTools::measurementInvariance().

  • See also Measurement invariance explorer - Shiny App

Tools for labelled data and Rstudio viewer

Know the labels:

  • label_book Creates a codebook for data.frames with labels.

Make use of labels:

  • cor_table Prints ready-to-publish correlation tables with significance stars.
  • crosstab Simple cross-tabulation with labels.

Get rid of labels and other tidyverse attributes:

  • drop_labs Drops labels if you don't need them.
  • untibble Get rid of tibble and get clean data.frame.
  • lab_to_fac Converts labelled variables to factors.

Make use of Rstudio viewer:

  • df_to_viewer Puts any data.frame to RStudio viewer. Also works with models and anything that can be passed through stargazer or kable.

Values, Schwartz, ESS

  • values list of value labels.
  • download_ess Download European Social Survey data
  • schwartz_circle Draw Schwartz circle and more with three simple functions: add_circle, add_radius, and add_label.
  • ess_values Computes 2, 4, or 10 value indices as they are measured in ESS.

Miscellaneous

  • reverse Recodes variable in reverse order. Works with labels.
  • replace_by_table Useful for recoding when matching tables are alsready specified in a table. Particularly useful for translation.
  • mean_se_lower_upper Simply mean, SE, upper and lower 95% CI.
  • verb Simply prints its arguments.
  • rename Renames variables in data.frame without bullshittery.
  • theme_mr Clean theme for ggplot.

News

  • convergencePlotsMplus Extract Bayesian data from data Mplus, draw trace plots and autocorrelation plots, and save in a single pdf.

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published

Languages