quest
is a package for pre-processing questionnaire data
to get it ready for statistical modeling. It contains functions for
investigating missing data (e.g., rowNA
), reshaping data
(e.g., wide2long
), validating responses (e.g.,
revalids
), recoding variables (e.g., recodes
),
scoring (e.g., scores
), centering (e.g.,
centers
), aggregating (e.g., aggs
), shifting
(e.g., shifts
), etc. Functions whose first phrases end with
an s
are vectorized versions of their functions without an s
at the end of the first phrase. For example, center
inputs a
(atomic) vector and outputs a atomic vector to center and/or scale a single
variable; centers
inputs a data.frame and outputs a data.frame to
center and/or scale multiple variables. Functions that end in _by
are calculated by group. For example, center
does grand-mean
centering while center_by
does group-mean centering. Putting the two
together, centers_by
inputs a data.frame and outputs a data.frame to
center and/or scale multiple variables by group. Functions that end in
_ml
calculate a "multilevel" result with a within-group result and
between-group result. Functions that end in _if
are calculated
dependent on the frequency of observed values (aka amount of missing data).
The quest
package uses the str2str
package internally to
convert R objects from one structure to another. See str2str
for details.
There are three main types of functions. 1)
Helper functions that primarily exist to save a few lines of code and are
primarily for convenience (e.g., vecNA
). 2) Functions for
wrangling questionnaire data (e.g., nom2dum
,
reverses
). 3) Functions for preliminary statistical
calculation (e.g., means_diff
, corp_by
).
See the table below
variable
group
names
missing values
observed values
proportion
separator
correlations
identifier
return
function
data.frame
factor
nominal variable
binary variable
dummy variable
percentage of maximum possible
standardize
within-groups
between-groups
Maintainer: David Disabato ddisab01@gmail.com (ORCID)