analyze: analyze

Description Usage Arguments Value Author(s) See Also

View source: R/analyze.R

Description

results Performs an analysis for a data frame containing a response and an explanatory variable. The key functions are:

formatData(d, y, x)

Takes three variables: d, a data frame containing response and explanatory variable; y, a label for the response variable; and x, a label for the explanatory variable, and returns the original raw data as well as the summarized observed and expected frequencies.

x2(d, y, x, conf, alpha)

Takes four variables: d, a data frame containing response and explanatory variable;, y, a label for the response variable; x, a label for the explanatory variable; conf numeric between 0 and 1 that indicates the confidence level; and alpha a number between 0 and 1 that indicates the probability of a type I error. It returns the results of a chi-square test of independence with plot and descriptive statements regarding the result.

zTest(d, success, order, alternative, conf, alpha)

Takes six variables: d, a data frame containing response and explanatory variable; success is the level of the response variable considered for analysis; order is the order of the levels for the explanatory variable;, alternative is the alternative hypothesis for the test; conf numeric between 0 and 1 that indicates the confidence level; and alpha a number between 0 and 1 that indicates the probability of a type I error. It returns the results of a two-proportion z-test with descriptive statements.

propTest(d, order, alternative, success, conf, alpha)

Takes six variables: d, a data frame containing response and explanatory variable; success is the level of the response variable considered for analysis; order is the order of the levels for the explanatory variable;, alternative is the alternative hypothesis for the test; conf numeric between 0 and 1 that indicates the confidence level; and alpha a number between 0 and 1 that indicates the probability of a type I error. It returns the results of a two-proportion z-test with descriptive statements.

Usage

1
2
analyze(data, y, x, title, success = "Traditional", scope, conf = 0.95,
  alpha = 0.05)

Arguments

data

Data frame containing two columns; the response and the explanatory variable.

y

Character string label for the response variable.

x

Character string label for the explanatory variable.

title

Character string containing title of the plot

success

Character string equivalent to the response variable level to be analyzed.

scope

Character string indicating the scope of the data.

conf

Numeric between 0 and 1, indicates desired confidence level for hypothesis test.

alpha

Numeric between 0 and 1, indicates the target probability of a type I error.

Value

list containing three types of objects: (1) data, both raw and summarized observed and expected frequencies, (2) plots, observed and expected frequencies and proportions in bar plot format, and (3), tests the results of the independence and proportion tests. group a

Author(s)

John James, jjames@datasciencesalon.org

See Also

Other xmar functions: X23D, X2, analyze3d, discussion, formatData, plotBars, preprocess, propTest, univariate, zTest


DataScienceSalon/xmar documentation built on May 28, 2019, 12:24 p.m.