p_test: Calculate the p-value of the null hypothesis that two...

View source: R/p_test.R

p_testR Documentation

Calculate the p-value of the null hypothesis that two outcomes are from the same dataset

Description

Specify an outcome variable and return p-test outputs. All numeric variables in the dataset are used as predictor variables.

Usage

p_test(data, outcome, behavior, paired = FALSE)

Arguments

data

A Person Query dataset in the form of a data frame.

outcome

A string specifying the name of a binary variable, i.e. can only contain the values 1 or 0. Used to group the two distributions.

behavior

A character vector specifying the column to be used as the behavior to test.

paired

Specify whether the dataset is paired or not. Defaults to TRUE.

Details

This function is a wrapper around wilcox.test() from 'stats'.

Value

Returns a numeric value representing the p-value outcome of the test.

Author(s)

Mark Powers mark.powers@microsoft.com

See Also

Other Support: camel_clean(), check_inputs(), combine_signals(), cut_hour(), extract_date_range(), extract_hr(), heat_colours(), is_date_format(), maxmin(), pairwise_count(), plot_WOE(), read_preamble(), rgb2hex(), totals_bind(), totals_col(), totals_reorder(), tstamp(), us_to_space(), wrap()

Examples

# Simulate a binary variable X
# Returns a single p-value
library(dplyr)
sq_data %>%
  mutate(X = ifelse(Email_hours > 6, 1, 0)) %>%
  p_test(outcome = "X", behavior = "External_network_size")


wpa documentation built on Aug. 21, 2023, 5:11 p.m.

Related to p_test in wpa...