File: anovaOld.Rd

package info (click to toggle)
r-cran-ordinal 2022.11-16-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,856 kB
  • sloc: ansic: 979; sh: 13; makefile: 5
file content (71 lines) | stat: -rw-r--r-- 2,261 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
\name{anova.clm2}
%%\alias{anova}
\alias{anova.clm2}
\alias{anova.clmm2}
\title{Likelihood ratio test of cumulative link models}
\description{
  Comparison of cumulative link models in likelihood ratio tests.
  The models may differ by terms in location, scale and nominal
  formulae, in link, threshold function and random effect structure.
}
\usage{
\method{anova}{clm2}(object, ..., test = c("Chisq", "none"))
\method{anova}{clmm2}(object, ..., test = c("Chisq", "none"))
}
\arguments{
  \item{object}{a \code{\link{clm2}} object.
  }
  \item{\dots}{one or more additional \code{\link{clm2}} objects.
  }
  \item{test}{if \code{test = "none"} the p-value for the likelihood
    ratio test is suppressed.
  }
}
\value{
  The method returns an object of class \code{Anova} (for printing) and
  \code{data.frame} with the following elements
  \item{Model}{character description of the cumulative link models being
    compared. Location, scale and nominal formulae are separated by
    "|"s in this order.
  }
  \item{Resid.df}{the residual degrees of freedom
  }
  \item{-2logLik}{twice the negative log likelihood (proportional to the
    deviance)}
  \item{Test}{indication of which models are being compared.
  }
  \item{DF}{the difference in the degrees of freedom in the models being
    compared, i.e. the degrees of freedom for the chi-squared test.
  }
  \item{LR stat.}{the likelihood ratio statistic.
  }
  \item{Pr(Chi)}{the p-value from the likelihood ratio test. Absent if
    \code{test = "none"}.
  }
}
\author{Rune Haubo B Christensen}
\seealso{
  \code{\link[ordinal]{clm2}}, \code{\link[=addterm.clm2]{addterm}},
  \code{\link[ordinal:addtermOld]{dropterm}} and
  \code{\link[=anova]{anova.default}}
}
\examples{
options(contrasts = c("contr.treatment", "contr.poly"))
m1 <- clm2(SURENESS ~ PROD, scale = ~PROD, data = soup,
          link = "logistic")

## anova
anova(m1, update(m1, scale = ~.-PROD))
mN1 <- clm2(SURENESS ~ 1, nominal = ~PROD, data = soup,
           link = "logistic")
anova(m1, mN1)
anova(m1, update(m1, scale = ~.-PROD), mN1)

## Fit model from polr example:
if(require(MASS)) {
    fm1 <- clm2(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
    anova(fm1, update(fm1, scale =~ Cont))
}

}
\keyword{internal}