Learn R Programming

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

sjmisc (version 1.1)

Data Transformation and Labelled Data Utility Functions

Description

Collection of miscellaneous utility functions (especially intended for people coming from other statistical software packages like 'SPSS', and/or who are new to R), supporting following common tasks: 1) Reading and writing data between R and other statistical software packages like 'SPSS', 'SAS' or 'Stata' and working with labelled data; this includes easy ways to get and set label attributes, to convert labelled vectors into factors (and vice versa), or to deal with multiple declared missing values etc. 2) Data transformation tasks like recoding, dichotomizing or grouping variables, setting and replacing missing values. 3) Convenient functions to perform frequently used statistical tests, or to calculate various commonly used statistical coefficients.

Copy Link

Version

Install

install.packages('sjmisc')

Monthly Downloads

34,037

Version

1.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Lüdecke

Last Published

August 26th, 2015

Functions in sjmisc (1.1)

add_labels

Add value labels to variables
chisq_gof

Chi-square goodness-of-fit-test
recode_to

Recode variable categories into new values
dicho

Dichotomize variables
read_sas

Import SAS dataset as data frame into R
mic

Mean Inter-Item-Correlation
get_label

Retrieve variable label(s) of labelled data
is_empty

Check whether string is empty
mean_n

Row means with min amount of valid values
get_labels

Retrieve value labels of labelled data
as_labelled

Convert vector to labelled class
cod

Tjur's Coefficient of Discrimination
is_even

Check whether value is even
is_labelled

Check whether object is of class "labelled"
eta_sq

Eta-squared of fitted anova
get_na

Retrieve missing values of labelled variables
copy_labels

Copy value and variable labels to (subsetted) data frames
is_crossed

Check whether two factors are crossed
is_nested

Check whether two factors are nested
read_stata

Import STATA dataset as data frame into R
sjmisc-package

Data Transformation and Labelled Data Utility Functions
is_num_fac

Check whether a factor has numeric levels only
reliab_test

Performs a reliability test on an item scale
replace_na

Replace NA with specific values
trim

Trim leading and trailing whitespaces from strings
to_factor

Convert variable into factor and keep value labels
to_label

Convert variable into factor and replaces values with associated value labels
str_pos

Find partial matching and close distance elements in strings
table_values

Expected and relative table values
get_values

Retrieve values of labelled variables
zap_unlabelled

Convert non-labelled values into NA
cronb

Cronbach's Alpha for a matrix or data frame
group_labels

Create labels for recoded groups
cramer

Cramer's V for a contingency table
labelled

Create a labelled vector
group_str

Group near elements of string vectors
frq

Summary of labelled vectors
weight2

Weight a variable
icc

Intra-Class-Correlation Coefficient
levene_test

Plot Levene-Test for One-Way-Anova
std_beta

Standardized Beta coefficients and CI of lm and mixed models
weight

Weight a variable
efc

Sample dataset from the EUROFAMCARE project
get_na_flags

Retrieve missing value flags of labelled variables
to_sjPlot

Convert labelled data (frames) into normal classes
word_wrap

Insert line breaks in long labels
phi

Phi value for contingency tables
mwu

Mann-Whitney-U-Test
is_odd

Check whether value is odd
rmse

Root Mean Squared Error (RMSE)
fill_labels

Add missing value labels to partially labelled vector
hoslem_gof

Hosmer-Lemeshow Goodness-of-fit-test
zap_labels

Convert labelled values into NA
to_na

Convert missing values of labelled variables into NA
read_spss

Import SPSS dataset as data frame into R
pseudo_r2

Nagelkerke's and Cox-Snell's Pseudo R-squared
write_spss

Write content of data frame to SPSS sav-file
to_value

Convert factors to numeric variables
rec

Recode numeric variables
remove_labels

Remove value and variable labels from vector or data frame
set_label

Add variable label(s) to variables
group_var

Recode count variables into grouped factors
set_na

Set NA for specific variable values
set_labels

Add value labels to variables
write_stata

Write content of data frame to STATA dta-file
cv

Coefficient of Variation
se

Standard Error for variables