Learn R Programming

ndl (version 0.2.18)

crosstableStatistics: Calculate statistics for a contingency table

Description

crosstableStatistics takes a contingency table of observed vs. predicted values for a binary or polytomous response variable as input, and calculates a range of statistics about prediction accuracy.

Usage

crosstableStatistics(ctable)

Arguments

ctable

A contingency table cross-classifying observed and predicted values.

Value

A list with the following components:

accuracy

Overall prediction accuracy

recall.predicted

Recall of prediction for each outcome value

precision.predicted

Precision of prediction for each outcome value

lambda.prediction

lambda for prediction accuracy (improvement over baseline of always predicting mode)

tau.classification

tau for classification accuracy (improvement over baseline of homogeneous distribution of predicted outcomes)

d.lambda.prediction

d(lambda): used for calculating P(lambda)

d.tau.classification

d(tau): used for calculating P(tau)

p.lambda.prediction

P(lambda): probability of reaching lambda by chance

p.tau.classification

P(tau): probability of reaching tau by chance

References

Arppe, A. 2008. Univariate, bivariate and multivariate methods in corpus-based lexicography -- a study of synonymy. Publications of the Department of General Linguistics, University of Helsinki, No. 44. URN: http://urn.fi/URN:ISBN:978-952-10-5175-3.

Arppe, A. and Baayen, R. H. (in prep.). Statistical classification and principles of human learning.

Menard, Scott (1995). Applied Logistic Regression Analysis. Sage University Paper Series on Quantitative Applications in the Social Sciences 07-106. Thousand Oaks: Sage Publications.

See Also

See also modelStatistics, ndlStatistics, ndlClassify.

Examples

Run this code
# NOT RUN {
ctable <- matrix(c(30, 10, 5, 60), 2, 2)
crosstableStatistics(ctable)
# }

Run the code above in your browser using DataLab