Learn R Programming

MOTE (version 1.2.2)

v_chi_sq: V for Chi-Square

Description

This function displays \(V\) and its non-central confidence interval for the specified \(\chi^2\) statistic.

Usage

v_chi_sq(x2, n, r, c, a = 0.05)

v.chi.sq(x2, n, r, c, a = 0.05)

Value

v

\(V\) statistic

vlow

lower level confidence interval of \(V\)

vhigh

upper level confidence interval of \(V\)

n

sample size

df

degrees of freedom

x2

\(\chi^2\) statistic

p

p-value

estimate

the \(V\) statistic and confidence interval in APA style for markdown printing

statistic

the \(\chi^2\) statistic in APA style for markdown printing

Arguments

x2

chi-square statistic

n

sample size

r

number of rows in the contingency table

c

number of columns in the contingency table

a

significance level

Details

\(V\) is calculated by finding the square root of \(\chi^2\) divided by the product of the sample size and the smaller of the two degrees of freedom.

$$V = \sqrt{\frac{\chi^2}{n \times df_{\mathrm{small}}}}$$

Learn more on our example page.

**Note on function and output names:** This effect size is now implemented with the snake_case function name `v_chi_sq()` to follow modern R style guidelines. The original dotted version `v.chi.sq()` is still available as a wrapper for backward compatibility, and both functions return the same list. The returned object includes both the original element names (e.g., `v`, `vlow`, `vhigh`, `n`, `df`, `x2`, `p`, `estimate`, `statistic`) and newer snake_case aliases (e.g., `v_value`, `v_lower_limit`, `v_upper_limit`, `sample_size`, `df_total`, `chi_square`, `p_value`). New code should prefer `v_chi_sq()` and the snake_case output names, but existing code using the older names will continue to work.

Examples

Run this code

# The following example is derived from the "chisq_data"
# dataset, included in the MOTE library.

# Individuals were polled about their number of friends (low, medium, high)
# and their number of kids (1, 2, 3+) to determine if there was a
# relationship between friend groups and number of children, as we
# might expect that those with more children may have less time for
# friendship maintaining activities.

chisq.test(chisq_data$kids, chisq_data$friends)

v_chi_sq(x2 = 2.0496, n = 60, r = 3, c = 3, a = .05)

# Backwards-compatible dotted name (deprecated)
v.chi.sq(x2 = 2.0496, n = 60, r = 3, c = 3, a = .05)

Run the code above in your browser using DataLab