Learn R Programming

hmmm (version 1.0-4)

print.hmmmfit: print for the class hmmmfit

Description

The generic function `print' is adapted to the objects inheriting from class hmmmfit (print.hmmmfit) to display the results of the estimation of a hmm model by `hmmm.mlfit'.

Usage

# S3 method for hmmmfit
print(x, aname = " ", printflag = FALSE, ...)

Arguments

x

An object of the class hmmmfit, i.e. a result of `hmmm.mlfit'

aname

The name of the fitted object model

printflag

If FALSE only the goodness-of-fit test is displayed, if TRUE the estimates of the interaction parameters are also returned

Further arguments passed to or from other methods

Details

The output provides the likelihood ratio statistic test to assess the fitting of the model estimated by `hmmm.mlfit'. Degrees of freedom and pvalues are meaningful only for the hmm models without inequality constraints (see `hmmm.chibar' to test hmm models defined under inequality constraints on interactions). Moreover, if printflag is TRUE, the estimated interactions are displayed for every stratum, together with the marginal sets where they are defined and the type of logits considered.

See Also

hmmm.mlfit, summary.hmmmfit, anova.hmmmfit

Examples

Run this code
# NOT RUN {
data(relpol)
y<-getnames(relpol,st=12)
# 1 = Religion, 2 = Politics
names<-c("Rel","Pol")
marglist<-c("l-m","m-g","l-g")
marginals<-marg.list(marglist,mflag="m")

# Hypothesis of stochastic independence: all log odds ratios are null 
model<-hmmm.model(marg=marginals,lev=c(3,7),sel=c(9:20),names=names)
fitmodel<-hmmm.mlfit(y,model)
print(fitmodel,aname="independence model",printflag=TRUE)
# summary(fitmodel)
# }

Run the code above in your browser using DataLab