Learn R Programming

rcompanion (version 1.13.2)

freemanTheta: Freeman's theta

Description

Calculates Freeman's theta for a table with one ordinal variable and one nominal variable.

Usage

freemanTheta(x, g = NULL, group = "row", verbose = FALSE,
  progress = FALSE, digits = 3)

Arguments

x

Either a two-way table or a two-way matrix. Can also be a vector of observations of an ordinal variable.

g

If x is a vector, g is the vector of observations for the grouping, nominal variable.

group

If x is a table or matrix, group indicates whether the "row" or the "column" variable is the nominal, grouping variable.

verbose

If TRUE, prints statistics for each comparison.

progress

If TRUE, prints a message as each comparison is conducted.

digits

The number of significant digits in the output.

Value

A single statistic, Freeman's theta

Details

Freeman's coefficent of differentiation (theta) is used as a measure of association for a two-way table with one ordinal and one nominal variable. See Freeman (1965).

Currently, the function makes no provisions for NA values in the data. It is recommended that NAs be removed beforehand.

References

Freeman, L.C. 1965. Elementary Applied Statistics for Students in Behavioral Science. Wiley.

http://rcompanion.org/handbook/H_11.html

See Also

epsilonSquared

Examples

Run this code
# NOT RUN {
data(Breakfast)
library(coin)
chisq_test(Breakfast, scores = list("Breakfast" = c(-2, -1, 0, 1, 2)))
freemanTheta(Breakfast)

### Example from Freeman (1965), Table 10.6
Input =(
"Social.adjustment  5  4  3  2  1
Marital.status
Single              1  2  5  2  0
Married            10  5  5  0  0
Widowed             0  0  2  2  1
Divorced            0  0  0  2  3
")
Table = as.table(read.ftable(textConnection(Input)))
freemanTheta(Table)

data(PoohPiglet)
kruskal.test(Likert ~ Speaker, data = PoohPiglet)
freemanTheta(x = PoohPiglet$Likert, g = PoohPiglet$Speaker)

# }

Run the code above in your browser using DataLab