correlational: Correlational Research

Description Usage Arguments Value Examples

Description

Provides a recommended statistical method given the measurement level of your data. Appropriate for correlational research.

Usage

1
correlational(data, dep, independents, controls = NULL)

Arguments

data

the data as a data frame, with variables encoded as numeric (for interval/ratio variables), ordered (for ordinal variables), or factor (for nominal variables)

dep

a string naming variable 1 / the dependent variable from data

independents

a string or vector of strings naming variable 2 / the independent variable(s) from data

controls

a string or vector of strings naming the control variable(s) from data

Value

A results object containing:

results$advice the method recommendation
results$plotsIndependents scatter plots of the dependent variable and the independent variables
results$plotsControls scatter plots of the dependent variable and the control variables

Examples

1
2
3
4
5
6
7
8
exampleData <- data.frame(x1 = rnorm(20),
                          x2 = as.factor(c(rep(1, 10), rep(2, 10))),
                          x3 = as.ordered(c(rep(1, 5), rep(2, 5), rep(3, 10))),
                          x4 = rnorm(20),
                          x5 = rnorm(20))

correlational(exampleData, dep = 'x3', independents = 'x2')
correlational(exampleData, dep = 'x1', independents = c('x2', 'x3'), controls = c('x4', 'x5'))

rivkamdevries/Statkat documentation built on May 24, 2019, 2:02 a.m.