likelihood.test: Likelihood Ratio (G test) for contingency tables

Description Usage Arguments Value Author(s) See Also Examples

View source: R/contingency.tables.R

Description

Performs a likelihood ratio test of independence

Usage

1
likelihood.test(x,y=NULL,conservative=FALSE)

Arguments

x

A vector or a matrix

y

A vector that is ignored if x is a matrix and required if x is a vector

conservative

If TRUE, the Williams' continuity correction is used

Value

A list with class "htest" containing the following components:

statistic

the value the chi-squared test statistic.

parameter

the degrees of freedom of the approximate chi-squared distribution of the test statistic.

p.value

the p-value for the test.

method

a character string indicating the type of test performed, and whether the continuity correction was used.

data.name

a character string giving the name(s) of the data.

Author(s)

Pete Hurd and Ian Fellows

See Also

chisq.test

Examples

1
2

Example output

Loading required package: ggplot2
Loading required package: JGR
Loading required package: rJava
Loading required package: JavaGD

Please type JGR() to launch console. Platform specific launchers (.exe and .app) can also be obtained at http://www.rforge.net/JGR/files/.


Loading required package: car
Loading required package: carData
Loading required package: MASS
Registered S3 methods overwritten by 'lme4':
  method                          from
  cooks.distance.influence.merMod car 
  influence.merMod                car 
  dfbeta.influence.merMod         car 
  dfbetas.influence.merMod        car 


Note Non-JGR console detected:
	Deducer is best used from within JGR (http://jgr.markushelbig.org/).
	To Bring up GUI dialogs, type deducer().


	Log likelihood ratio (G-test) test of independence without correction

data:  InsectSprays$count > 7 and InsectSprays$spray
Log likelihood ratio statistic (G) = 79.105, X-squared df = 5, p-value
= 1.332e-15

Deducer documentation built on May 2, 2019, 8:35 a.m.