Learn R Programming

CUB (version 0.1)

chi2cub: Pearson $X^2$ statistic

Description

Compute the $X^2$ statistic of Pearson for CUB models with one or two discrete covariates for the feeling component.

Usage

chi2cub(m, ordinal, W, pai, gama)

Arguments

m
Number of ordinal categories
ordinal
Vector of ordinal responses
W
Matrix of covariates for the feeling component
pai
Uncertainty parameter
gama
Vector of parameters for the feeling component, with length equal to NCOL(W)+1 to account for an intercept term (first enry of gama)

Value

It returns the following results in a list:
df
Number of degrees of freedom
chi2
Value of the Pearson fitting measure
dev
Deviance indicator

References

Tutz, G. (2012). Regression for Categorical Data, Cambridge University Press, Cambridge

Examples

Run this code
data(univer)
m<-7
ordinal<-univer[,8]
W<-univer[,4]
pai<-0.3
gama<-c(0.1,0.7)
pearson<-chi2cub(m, ordinal, W, pai, gama)
degfree<-pearson$df
statvalue<-pearson$chi2
deviance<-pearson$dev

Run the code above in your browser using DataLab