long2wide.fn: long2wide.fn: This function transforms a 3-column dataset of...

View source: R/agree.coeff2.r

long2wide.fnR Documentation

long2wide.fn: This function transforms a 3-column dataset of frequencies to a square matrix or a contingency table. This function uses the freq.supp.fn() function.

Description

long2wide.fn: This function transforms a 3-column dataset of frequencies to a square matrix or a contingency table. This function uses the freq.supp.fn() function.

Usage

long2wide.fn(freqs.long)

Arguments

freqs.long

A 3-column data frame, where the first 2 variables represent the categories that both raters have actually used when classifying the subjects. The third and last variable is generally named "n" and represents the count of subjects that classified into the 2 associated categories by both raters.

Value

A matrix that represents a contingency showing the distribution of subjects by rater and category.

Examples

#The dataset "freqs.data" comes with this package. Analyze it as follows:
long2wide.fn(freqs.data) #Yields a 5x5 matrix
This will produce the following 5x5 matrix:
> long2wide.fn(freqs.data)
a b c d e
a 0 1 0 1 0
b 0 2 0 0 0
c 0 0 3 0 0
d 0 1 0 1 0
e 0 0 0 0 1

kgwet/irrCAC documentation built on Feb. 12, 2024, 11:48 p.m.