From af7c6de4db9981ac814362c441fbac22c8faa2d7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 24 Nov 2022 09:02:26 +0100 Subject: Start online docs of the development version --- docs/dev/reference/lrtest.mkinfit.html | 283 ++++++++++++++------------------- 1 file changed, 115 insertions(+), 168 deletions(-) (limited to 'docs/dev/reference/lrtest.mkinfit.html') diff --git a/docs/dev/reference/lrtest.mkinfit.html b/docs/dev/reference/lrtest.mkinfit.html index f2d8472e..a7198474 100644 --- a/docs/dev/reference/lrtest.mkinfit.html +++ b/docs/dev/reference/lrtest.mkinfit.html @@ -1,71 +1,16 @@ - - - - - - - -Likelihood ratio test for mkinfit models — lrtest.mkinfit • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Likelihood ratio test for mkinfit models — lrtest.mkinfit • mkin - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -155,115 +100,117 @@ that the models are nested, i.e. one of them has less degrees of freedom and can be expressed by fixing the parameters of the other.

-
# S3 method for mkinfit
-lrtest(object, object_2 = NULL, ...)
+    
+
# S3 method for mkinfit
+lrtest(object, object_2 = NULL, ...)
+
+# S3 method for mmkin
+lrtest(object, ...)
+
+ +
+

Arguments

+
object
+

An mkinfit object, or an mmkin column +object containing two fits to the same data.

+ -# S3 method for mmkin -lrtest(object, ...)
+
object_2
+

Optionally, another mkinfit object fitted to the same data.

-

Arguments

- - - - - - - - - - - - - - -
object

An mkinfit object, or an mmkin column -object containing two fits to the same data.

object_2

Optionally, another mkinfit object fitted to the same data.

...

Argument to mkinfit, passed to -update.mkinfit for creating the alternative fitted object.

-

Details

+
...
+

Argument to mkinfit, passed to +update.mkinfit for creating the alternative fitted object.

+
+
+

Details

Alternatively, an argument to mkinfit can be given which is then passed -to update.mkinfit to obtain the alternative model.

-

The comparison is then made by the lrtest.default +to update.mkinfit to obtain the alternative model.

+

The comparison is then made by the lrtest.default method from the lmtest package. The model with the higher number of fitted parameters (alternative hypothesis) is listed first, then the model with the lower number of fitted parameters (null hypothesis).

+
-

Examples

-
# \dontrun{ -test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent") -sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE) -dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE) -lrtest(dfop_fit, sfo_fit) -
#> Likelihood ratio test -#> -#> Model 1: DFOP with error model const -#> Model 2: SFO with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 5 -42.453 -#> 2 3 -63.954 -2 43.002 4.594e-10 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
lrtest(sfo_fit, dfop_fit) -
#> Likelihood ratio test -#> -#> Model 1: DFOP with error model const -#> Model 2: SFO with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 5 -42.453 -#> 2 3 -63.954 -2 43.002 4.594e-10 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
-# The following two examples are commented out as they fail during -# generation of the static help pages by pkgdown -#lrtest(dfop_fit, error_model = "tc") -#lrtest(dfop_fit, fixed_parms = c(k2 = 0)) - -# However, this equivalent syntax also works for static help pages -lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) -
#> Likelihood ratio test -#> -#> Model 1: DFOP with error model tc -#> Model 2: DFOP with error model const -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 6 -34.587 -#> 2 5 -42.453 -1 15.731 7.302e-05 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) -
#> Likelihood ratio test -#> -#> Model 1: DFOP with error model const -#> Model 2: DFOP with error model const and fixed parameter(s) k2 -#> #Df LogLik Df Chisq Pr(>Chisq) -#> 1 5 -42.453 -#> 2 4 -57.340 -1 29.776 4.851e-08 *** -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# } -
+
+

Examples

+
# \dontrun{
+test_data <- subset(synthetic_data_for_UBA_2014[[12]]$data, name == "parent")
+sfo_fit <- mkinfit("SFO", test_data, quiet = TRUE)
+dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE)
+lrtest(dfop_fit, sfo_fit)
+#> Likelihood ratio test
+#> 
+#> Model 1: DFOP with error model const
+#> Model 2: SFO with error model const
+#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
+#> 1   5 -42.453                         
+#> 2   3 -63.954 -2 43.002  4.594e-10 ***
+#> ---
+#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+lrtest(sfo_fit, dfop_fit)
+#> Likelihood ratio test
+#> 
+#> Model 1: DFOP with error model const
+#> Model 2: SFO with error model const
+#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
+#> 1   5 -42.453                         
+#> 2   3 -63.954 -2 43.002  4.594e-10 ***
+#> ---
+#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+# The following two examples are commented out as they fail during
+# generation of the static help pages by pkgdown
+#lrtest(dfop_fit, error_model = "tc")
+#lrtest(dfop_fit, fixed_parms = c(k2 = 0))
+
+# However, this equivalent syntax also works for static help pages
+lrtest(dfop_fit, update(dfop_fit, error_model = "tc"))
+#> Likelihood ratio test
+#> 
+#> Model 1: DFOP with error model tc
+#> Model 2: DFOP with error model const
+#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
+#> 1   6 -34.587                         
+#> 2   5 -42.453 -1 15.731  7.302e-05 ***
+#> ---
+#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0)))
+#> Likelihood ratio test
+#> 
+#> Model 1: DFOP with error model const
+#> Model 2: DFOP with error model const and fixed parameter(s) k2
+#>   #Df  LogLik Df  Chisq Pr(>Chisq)    
+#> 1   5 -42.453                         
+#> 2   4 -57.340 -1 29.776  4.851e-08 ***
+#> ---
+#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+# }
+
+
+
- - - + + -- cgit v1.2.1