Learn R Programming

UAHDataScienceSF (version 1.0.0)

chisquared: Chi-squared Distribution Function

Description

This function calculates the chi-squared statistic between two groups.

Usage

chisquared(x = NULL, y = NULL, learn = FALSE, interactive = FALSE)

Value

The chi-squared statistic (for non-interactive mode)

Arguments

x

Optional first vector (not needed for interactive mode)

y

Optional second vector (not needed for interactive mode)

learn

Logical, if TRUE shows step-by-step explanation

interactive

Logical, if TRUE enables interactive practice mode

Examples

Run this code
x <- c(70,75,74,72,68,59)
y <- c(74,77,70,80,72,76)

# Simple calculation
chisquared(x, y)

# Learning mode
chisquared(x, y, learn = TRUE)

# Interactive mode
if(interactive()){
chisquared(interactive = TRUE)
}

Run the code above in your browser using DataLab