@@ -54,7 +54,7 @@ summary.fastLm <- function(object, ...) {
5454 object $ coefficients <- cbind(Estimate = coef ,
5555 " Std. Error" = se ,
5656 " t value" = tval ,
57- " Pr(>|t|)" = 2 * pt(- abs(tval ), df = object $ df ))
57+ " Pr(>|t|)" = 2 * pt(- abs(tval ), df = object $ df.residual ))
5858
5959 # # cf src/stats/R/lm.R and case with no weights and an intercept
6060 f <- object $ fitted.values
@@ -66,7 +66,7 @@ summary.fastLm <- function(object, ...) {
6666 object $ r.squared <- mss / (mss + rss )
6767 df.int <- if (object $ intercept ) 1L else 0L
6868 n <- length(f )
69- rdf <- object $ df
69+ rdf <- object $ df.residual
7070 object $ adj.r.squared <- 1 - (1 - object $ r.squared ) * ((n - df.int )/ rdf )
7171 class(object ) <- " summary.fastLm"
7272 object
@@ -82,7 +82,7 @@ print.summary.fastLm <- function(x, ...) {
8282
8383 printCoefmat(x $ coefficients , P.values = TRUE , has.Pvalue = TRUE , ... )
8484 cat(" \n Residual standard error: " , formatC(x $ s , digits = digits ), " on " ,
85- formatC(x $ df ), " degrees of freedom\n " , sep = " " )
85+ formatC(x $ df.residual ), " degrees of freedom\n " , sep = " " )
8686 cat(" Multiple R-squared: " , formatC(x $ r.squared , digits = digits ),
8787 " ,\t Adjusted R-squared: " ,formatC(x $ adj.r.squared , digits = digits ),
8888 " \n " , sep = " " )
0 commit comments