Learn R Programming

CUB (version 0.1)

cub00: Main function for CUB models without covariates

Description

Function to estimate and validate a CUB model without covariates for given ordinal responses.

Usage

cub00(m, ordinal, maxiter, toler, makeplot,summary)

Arguments

m
Number of ordinal categories
ordinal
Vector of ordinal responses
maxiter
Maximum number of iterations allowed for running the optimization algorithm
toler
Fixed error tolerance for final estimates
makeplot
Logical: if TRUE, the function returns a graphical plot comparing fitted probabilities and observed relative frequencies
summary
Logical: if TRUE, summary results of the fitting procedure are displayed on screen

Value

An object of the class "CUB"

See Also

CUB, probbit, probcub00, loglikCUB

Examples

Run this code
#Running donttest option since the proposed examples require a long time run for check 

data(univer)
m=7
ordinal=univer[,12]
model=cub00(m, ordinal, maxiter=500, toler=1e-6, makeplot=TRUE,summary=TRUE)
parest=model$estimates  #ML estimates (pai,csi)
maxlik=model$loglik
nniter=model$niter
vmat=model$varmat
BICCUB=model$BIC
#############################
informat=univer[,8]
model=cub00(m,informat,maxiter=500,toler=1e-6,makeplot=FALSE,summary=FALSE)
parest=model$estimates   #ML estimates (pai,csi)
maxlik=model$loglik
nniter=model$niter
vmat=model$varmat
BICCUB=model$BIC

Run the code above in your browser using DataLab