lrttest_on_summary_table: Calculate Likelihood Ratio Test (LRT) results, and add to...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_generics_v1.R

Description

The Likelihood Ratio Test (LRT) is a standard method for testing whether or not the data likelihood conferred by a more complex is significantly better than the data likelihood conferred by the simpler model, given a certain number of extra free parameters for the complex model. The null hypothesis is that there is no difference; rejection means that there is a statistically significant improvement in the more complex model.

Usage

1
2
3
  lrttest_on_summary_table(restable, row_to_use_as_null,
    rows_to_exclude, returnwhat = "pval",
    add_to_table = TRUE)

Arguments

restable

A data.frame with at least columns named "LnL" and "nparams".

row_to_use_as_null

This is the row specifying the model to which the others will be compared in pairwise fashion.

rows_to_exclude

Some rows may have models that the simpler model cannot nest within. These should be excluded.

returnwhat

If "pval", just return the p-value. If "all", return all of the intermediate outputs.

add_to_table

If TRUE, add to the main table and return the main table. If FALSE, return just the Akaike Weights results.

Details

The LRT only works for situations in which the simpler model is nested within the more complex model (i.e., by taking some parameters of the more complex model and forcing them to be fixed to a specific value). In addition, the LRT may be unreliable in data-poor situations, and inherits whatever difficulties there may be in ML searches. See Burnham et al. (2002) for discussion.

This function assumes that the log-likelihoods are in the column "LnL", and the number of parameters is specified in "nparams"

Value

pval or LRTrow, both data.frame. Depends on returnwhat.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Burnham_Anderson_2002

Matzke_2012_IBS

See Also

lrttest

Examples

1
test=1

Example output

Loading required package: rexpokit
Loading required package: SparseM

Attaching package: 'SparseM'

The following object is masked from 'package:base':

    backsolve

Loading required package: Rcpp
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.