Shapiro-Francia test error I'm trying to run a normality test on the residuals after fitting a mixed-effect model (with lmer).  I read that the Shapiro-Francia test can deal with data with more than 5000 observations (I have more than 8000), but when I run it I get an error:
sf.test(resid(dat.lmer11))

Error in sf.test(resid(dat.lmer11)) : 
  sample size must be between 5 and 5000
Could anyone help, please?
 A: Just edit the sf.test() to allow for the big vector
sf.testBIG=function (x) 

    {
    DNAME <- deparse(substitute(x))
    x <- sort(x[complete.cases(x)])
    n <- length(x)
    if ((n < 5 || n > 10000))   ###            <-----here is my edit
        stop("sample size must be between 5 and 10,000")
    y <- qnorm(ppoints(n, a = 3/8))
    W <- cor(x, y)^2
    u <- log(n)
    v <- log(u)
    mu <- -1.2725 + 1.0521 * (v - u)
    sig <- 1.0308 - 0.26758 * (v + 2/u)
    z <- (log(1 - W) - mu)/sig
    pval <- pnorm(z, lower.tail = FALSE)
    RVAL <- list(statistic = c(W = W), p.value = pval, method = 
       "Shapiro-Francia normality test", 
        data.name = DNAME)
    class(RVAL) <- "htest"
    return(RVAL)
}

Then run your test on data that is bigger than the package creator intends.
sf.testBig(resid(dat.lmer11))

Also, bear in mind that the normality test's null and alternative hypothesis are usually backwards for most uses. Ie. Sometimes you can claim you have evidence for non-normality, but you can never have evidence for normality.
