Compare model fit performance among the models specified based on log-likelihood ratio's. Different in log-likelihood is calculated and degrees of freedom are given. P values are specified assuming a chi-quared distribution.

lr.test(object,...,type="sequential")

Arguments

object

An FLSAM or FLSAMs object

...

In combination with an FLSAM object: additional objects of the same type (need at least 1)

type

The type of comparison to make. A "sequential" comparison compares object 1 against object 2, object 2 against object 3,... whilt a "first" comparison compares object 1 against object 2, object 1 against object 3,...

Value

A summary table of the test characteristics is returned

Warning!

Log-likelihood tests can only be used for nested models (i.e. model parameterisation is different) and are not appropriate for different input data or different model types.

Author

Code by Anders Nielsen, implemented by Niels T. Hintzen and Mark R. Payne

See also

Examples

#- Load the data
data(HERAS.sams)

#- Run lr ratio test on example FLSAMs object
lr.test(HERAS.sams)
#>                        statistics
#> models                  Comparison Neg. log likel   # Parameters
#>   1 North Sea Herring   1 vs. 2    309.174660403857 18          
#>   2 North Sea Herring 2 2 vs. 3    168.861261408612 16          
#>   3 North Sea Herring 3 3 vs. 4    169.571440412931 15          
#>   4 North Sea Herring 4            172.990527772618 14          
#>                        statistics
#> models                  Likel difference Degrees of freedom P value
#>   1 North Sea Herring   -140.31          2                  1      
#>   2 North Sea Herring 2 0.71             1                  0.2333 
#>   3 North Sea Herring 3 3.42             1                  0.0089 
#>   4 North Sea Herring 4                                            

#- Run lr ratio test on individual FLSAM objects
lr.test(HERAS.sams[[1]],HERAS.sams[[2]],HERAS.sams[[3]])
#>                        statistics
#> models                  Comparison Neg. log likel   # Parameters
#>   1 North Sea Herring   1 vs. 2    309.174660403857 18          
#>   2 North Sea Herring 2 2 vs. 3    168.861261408612 16          
#>   3 North Sea Herring 3            169.571440412931 15          
#>                        statistics
#> models                  Likel difference Degrees of freedom P value
#>   1 North Sea Herring   -140.31          2                  1      
#>   2 North Sea Herring 2 0.71             1                  0.2333 
#>   3 North Sea Herring 3