|
25 | 25 | #' @param x An object of class 'pgls'. |
26 | 26 | #' @param phylo Return phylogenetically corrected residuals or ordinary |
27 | 27 | #' residuals (see details). |
| 28 | +#' @param REML Return the REML estimate of log likelihood - this is not |
| 29 | +#' implemented for PGLS models. |
28 | 30 | #' @param newdata Alternative data for predicting from 'pgls' models. |
29 | 31 | #' @param digits Number of digits to show in summary methods. |
30 | 32 | #' @param ... Further arguments to methods. |
@@ -202,7 +204,7 @@ coef.pgls <- function(object, ...) { |
202 | 204 | return(cf) |
203 | 205 | } |
204 | 206 |
|
205 | | -#' @describeIn pgls Extract residuals from a pgls model |
| 207 | +#' @describeIn pgls-methods Extract residuals from a pgls model |
206 | 208 | #' @export |
207 | 209 | residuals.pgls <- function(object, phylo = FALSE, ...) { |
208 | 210 | ret <- NULL |
@@ -244,6 +246,9 @@ predict.pgls <- function(object, newdata = NULL, ...) { |
244 | 246 | #' @describeIn pgls-methods Extract the log likelihood from a pgls model |
245 | 247 | #' @export |
246 | 248 | logLik.pgls <- function(object, REML = FALSE, ...) { |
| 249 | + if (isTRUE(REML)) { |
| 250 | + stop("Calculation of REML estimates of logLik not supported for pgls") |
| 251 | + } |
247 | 252 | val <- object$model$log.lik |
248 | 253 |
|
249 | 254 | attr(val, "nall") <- object$n |
@@ -283,7 +288,7 @@ nobs.pgls <- function(object, ...) length(stats::resid(object)) |
283 | 288 | #' mod1 <- pgls(log(Egg.Mass) ~ log(M.Mass) * log(F.Mass), shorebird) |
284 | 289 | #' graphics::par(mfrow = c(2, 2)) |
285 | 290 | #' plot(mod1) |
286 | | -#' |
| 291 | +#' @export |
287 | 292 | plot.pgls <- function(x, ...) { |
288 | 293 | res <- stats::residuals(x, phylo = TRUE) |
289 | 294 | res <- res / sqrt(stats::var(res))[1] |
|
0 commit comments