durbin_watson <- function(x){ x_lead <- dplyr::lead(x) x_lead[is.na(x_lead)] <- 0 (sum((x-x_lead)^2)) / (sum((x^2))) }
Add the following code to your website.
REMOVE THIS Copy to clipboard
For more information on customizing the embed code, read Embedding Snippets.