Learn R Programming

quest (version 0.2.0)

Prepare Questionnaire Data for Analysis

Description

Offers a suite of functions to prepare questionnaire data for analysis (perhaps other types of data as well). By data preparation, I mean data analytic tasks to get your raw data ready for statistical modeling (e.g., regression). There are functions to investigate missing data, reshape data, validate responses, recode variables, score questionnaires, center variables, aggregate by groups, shift scores (i.e., leads or lags), etc. It provides functions for both single level and multilevel (i.e., grouped) data. With a few exceptions (e.g., ncases()), functions without an "s" at the end of their primary word (e.g., center_by()) act on atomic vectors, while functions with an "s" at the end of their primary word (e.g., centers_by()) act on multiple columns of a data.frame.

Copy Link

Version

Install

install.packages('quest')

Monthly Downloads

186

Version

0.2.0

License

GPL (>= 2)

Maintainer

David Disabato

Last Published

December 5th, 2023

Functions in quest (0.2.0)

add_sig

Add Significance Symbols to a (Atomic) Vector, Matrix, or Array
amd_bi

Amount of Missing Data - Bivariate (Pairwise Deletion)
amd_multi

Amount of Missing Data - Multivariate (Listwise Deletion)
auto_by

Autoregressive Coefficient by Group
ave_dfm

Repeated Group Statistics for a Data-Frame
add_sig_cor

Add Significance Symbols to a Correlation Matrix
agg_dfm

Data Information by Group
aggs

Aggregate Data by Group
amd_uni

Amount of Missing Data - Univariate
agg

Aggregate an Atomic Vector by Group
change

Change Score from a Numeric Vector
centers

Centering and/or Standardizing Numeric Data
by2

Apply a Function to Data by Group
changes_by

Change Scores from Numeric Data by Group
boot_ci

Bootstrapped Confidence Intervals from a Matrix of Coefficients
center_by

Centering and/or Standardizing a Numeric Vector by Group
changes

Change Scores from Numeric Data
change_by

Change Scores from a Numeric Vector by Group
center

Centering and/or Standardizing a Numeric Vector
centers_by

Centering and/or Standardizing Numeric Data by Group
colSums_if

Column Sums Conditional on Frequency of Observed Values
colMeans_if

Column Means Conditional on Frequency of Observed Values
colNA

Frequency of Missing Values by Column
composites

Composite Reliability of Multiple Scores
confint2

Confidence Intervals from Statistical Information
composite

Composite Reliability of a Score
confint2.boot

Bootstrapped Confidence Intervals from a boot Object
confint2.default

Confidence Intervals from Parameter Estimates and Standard Errors
cor_ml

Multilevel Correlation Matrices
corp

Bivariate Correlations with Significant Symbols
corp_miss

Point-biserial Correlations of Missingness With Significant Symbols
corp_by

Bivariate Correlations with Significant Symbols by Group
decomposes

Decompose Numeric Data by Group
decompose

Decompose a Numeric Vector by Group
cronbachs

Cronbach's Alpha for Multiple Sets of Variables/Items
cronbach

Cronbach's Alpha of a Set of Variables/Items
corp_ml

corp_ml decomposes correlations from multilevel data into within-group and between-group correlations as well as adds significance symbols to the end of each value. The workhorse of the function is statsBy. corp_ml is simply a combination of cor_ml and add_sig_cor.
.cronbachs

Bootstrap Function for cronbachs() Function
.cronbach

Bootstrap Function for cronbach() Function
cor_miss

Point-biserial Correlations of Missingness
cor_by

Correlation Matrix by Group
.gtheory

Bootstrap Function for gtheory() Function
describe_ml

Multilevel Descriptive Statistics
covs_test

Covariances Test of Significance
deffs

Design Effects from Multilevel Numeric Data
deff

Design Effect from Multilevel Numeric Vector
freq

Univariate Frequency Table
freq_by

Univariate Frequency Table By Group
.gtheorys

Bootstrap Function for gtheorys() Function
dum2nom

Dummy Variables to a Nominal Variable
iccs_11

Intraclass Correlation for Multiple Variables for Multilevel Analysis: ICC(1,1)
freqs

Multiple Univariate Frequency Tables
freqs_by

Multiple Univariate Frequency Tables
gtheorys

Generalizability Theory Reliability of Multiple Scores
gtheorys_ml

Generalizability Theory Reliability of Multiple Multilevel Scores
length_by

Length of a (Atomic) Vector by Group
make.fun_if

Make a Function Conditional on Frequency of Observed Values
make.latent

Make Model Syntax for a Latent Factor in Lavaan
icc_all_by

All Six Intraclass Correlations by Group
make.dummy

Make Dummy Columns
icc_11

Intraclass Correlation for Multilevel Analysis: ICC(1,1)
make.dumNA

Make Dummy Columns For Missing Data.
gtheory_ml

Generalizability Theory Reliability of a Multilevel Score
mean_diff

Mean difference across two independent groups (independent two-samples t-test)
make.product

Make Product Terms (e.g., interactions)
gtheory

Generalizability Theory Reliability of a Score
mean_change

Mean Change Across Two Timepoints (dependent two-samples t-test)
mean_compare

Mean differences for a single variable across 3+ independent groups (one-way ANOVA)
long2wide

Reshape Multiple Scores From Long to Wide
lengths_by

Length of Data Columns by Group
mode2

Statistical Mode of a Numeric Vector
means_diff

Mean differences across two independent groups (independent two-samples t-tests)
means_test

Test for Multiple Sample Means Against Mu (one-sample t-tests)
means_change

Mean Changes Across Two Timepoints For Multiple PrePost Pairs of Variables (dependent two-samples t-tests)
means_compare

Mean differences for multiple variables across 3+ independent groups (one-way ANOVAs)
n_compare

Test for Equal Frequency of Values (chi-square test of goodness of fit)
ncases_desc

Describe Number of Cases in Data by Group
ncases_ml

Multilevel Number of Cases
nom2dum

Nominal Variable to Dummy Variables
nrow_by

Number of Rows in Data by Group
mean_if

Mean Conditional on Minimum Frequency of Observed Values
mean_test

Test for Sample Mean Against Mu (one-sample t-test)
partial.cases

Find Partial Cases
nrow_ml

Multilevel Number of Rows
ngrp

Number of Groups in Data
nhst

Null Hypothesis Significance Testing
pomp

Recode a Numeric Vector to Percentage of Maximum Possible (POMP) Units
ncases

Number of Cases in Data
ncases_by

Number of Cases in Data by Group
pomps

Recode Numeric Data to Percentage of Maximum Possible (POMP) Units
recodes

Recode Data
prop_compare

Proportion Comparisons for a Single Variable across 3+ Independent Groups (Chi-square Test of Independence)
prop_test

Test for Sample Proportion Against Pi (chi-square test of goodness of fit)
props_diff

Proportion Difference of Multiple Variables Across Two Independent Groups (Chi-square Tests of Independence)
props_compare

Proportion Comparisons for Multiple Variables across 3+ Independent Groups (Chi-square Tests of Independence)
renames

Rename Data Columns from a Codebook
quest-package

Pre-processing Questionnaire Data
recode2other

Recode Unique Values in a Character Vector to 0ther (or NA)
props_test

Test for Multiple Sample Proportion Against Pi (Chi-square Tests of Goodness of Fit)
reverses

Reverse Code Numeric Data
prop_diff

Proportion Difference for a Single Variable across Two Independent Groups (Chi-square Test of Independence)
score

Observed Unweighted Scoring of a Set of Variables/Items
rowMeans_if

Row Means Conditional on Frequency of Observed Values
rowsNA

Frequency of Multiple Sets of Missing Values by Row
revalids

Recode Invalid Values from Data
reorders

Reorder Levels of Factor Data
revalid

Recode Invalid Values from a Vector
tapply2

Apply a Function to a (Atomic) Vector by Group
scores

Observed Unweighted Scoring of Multiple Sets of Variables/Items
summary_ucfa

Summary of a Unidimensional Confirmatory Factor Analysis
shift

Shift a Vector (i.e., lag/lead)
shifts

Shift Data (i.e., lag/lead)
shift_by

Shift a Vector (i.e., lag/lead) by Group
rowSums_if

Row Sums Conditional on Frequency of Observed Values
rowNA

Frequency of Missing Values by Row
reverse

Reverse Code a Numeric Vector
ucfa

Unidimensional Confirmatory Factor Analysis
valid_test

Test for Invalid Elements in a Vector
shifts_by

Shift Data (i.e., lag/lead) by Group
sum_if

Sum Conditional on Minimum Frequency of Observed Values
winsors

Winsorize Numeric Data
wide2long

Reshape Multiple Sets of Variables From Wide to Long
winsor

Winsorize a Numeric Vector
vecNA

Frequency of Missing Values in a Vector
valids_test

Test for Invalid Elements in Data