Running 'glmfm.R' [2s]
  Comparing 'glmfm.Rout' to 'glmfm.Rout.save' ... OK
  Running 'lmfm.R' [160s]
Running the tests in 'tests/lmfm.R' failed.
Complete output:
  > options(warn = 2)
  > 
  > data(stackloss)
  > 
  > library(fit.models)
  > library(MASS)
  > 
  > # add rlm to the lmfm fit.models class
  > fmclass.add.class("lmfm", "rlm")
  rlm is already registered in the fit.models registry
  > 
  > ################################################################################
  > # Test original syntax
  > ################################################################################
  > 
  > fm1 <- fit.models(list(Robust = "rlm", LS = "lm"), stack.loss ~ ., data = stackloss)
  > print(fm1)
  
  Calls:
  Robust: rlm(formula = stack.loss ~ ., data = stackloss)
      LS: lm(formula = stack.loss ~ ., data = stackloss)
  
  Coefficients:
         (Intercept) Air.Flow Water.Temp Acid.Conc.
  Robust    -41.0265   0.8294     0.9261     -0.128
  LS        -39.9197   0.7156     1.2953     -0.152
  
  > print(fm1.sum <- summary(fm1, correlation = TRUE))
  
  Calls:
  Robust: rlm(formula = stack.loss ~ ., data = stackloss)
      LS: lm(formula = stack.loss ~ ., data = stackloss)
  
  Residual Statistics:
             Min     1Q   Median    3Q   Max
  Robust: -8.918 -1.731  0.06187 1.543 6.502
      LS: -7.238 -1.712 -0.45509 2.361 5.698
  
  Coefficients:
                       Estimate Std. Error t value Pr(>|t|)    
  (Intercept): Robust: -41.0265     9.8073  -4.183             
                   LS: -39.9197    11.8960  -3.356  0.00375 ** 
                                                               
     Air.Flow: Robust:   0.8294     0.1112   7.460             
                   LS:   0.7156     0.1349   5.307  5.8e-05 ***
                                                               
   Water.Temp: Robust:   0.9261     0.3034   3.052             
                   LS:   1.2953     0.3680   3.520  0.00263 ** 
                                                               
   Acid.Conc.: Robust:  -0.1278     0.1289  -0.992             
                   LS:  -0.1521     0.1563  -0.973  0.34405    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual Scale Estimates:
  Robust: 2.441 on 17 degrees of freedom
      LS: 3.243 on 17 degrees of freedom
  
  Multiple R-squared:
      LS: 0.9136 
  
  Correlations:
  Robust:
             (Intercept) Air.Flow Water.Temp
  Air.Flow    0.18                          
  Water.Temp -0.15       -0.74              
  Acid.Conc. -0.90       -0.34     0.00     
  
  LS:
             (Intercept) Air.Flow Water.Temp
  Air.Flow    0.18                          
  Water.Temp -0.15       -0.74              
  Acid.Conc. -0.90       -0.34     0.00     
  
  > 
  > pdf("fm1.pdf")
  > plot(fm1, 1)
  > plot(fm1, 2)
  > plot(fm1, 3)
  > plot(fm1, 4)
  > plot(fm1, 5)
  > plot(fm1, 6)
  > plot(fm1, 7)
  > plot(fm1, 8)
  > plot(fm1, 9)
  > dev.off()
  null device 
            1 
  > 
  > rm(fm1, fm1.sum)
  > file.remove("fm1.pdf")
  [1] TRUE
  > 
  > 
  > ################################################################################
  > # Test models with different subsets
  > ################################################################################
  > 
  > complete <- lm(stack.loss ~ ., data = stackloss)
  > clean <- lm(stack.loss ~ ., data = stackloss, subset = -c(1, 2, 4, 21))
  > fm2 <- fit.models(Clean = clean, Complete = complete)
  > print(fm2)
  
  Calls:
     Clean: lm(formula = stack.loss ~ ., data = stackloss, subset = -c(1, 
      2, 4, 21))
  Complete: lm(formula = stack.loss ~ ., data = stackloss)
  
  Coefficients:
           (Intercept) Air.Flow Water.Temp Acid.Conc.
  Clean       -42.0003   0.9555     0.5556     -0.113
  Complete    -39.9197   0.7156     1.2953     -0.152
  
  > print(fm2.sum <- summary(fm2, correlation = TRUE))
  
  Calls:
     Clean: lm(formula = stack.loss ~ ., data = stackloss, subset = -c(1, 
      2, 4, 21))
  Complete: lm(formula = stack.loss ~ ., data = stackloss)
  
  Residual Statistics:
               Min     1Q   Median     3Q   Max
     Clean: -3.122 -1.333 -0.03041 0.9755 3.652
  Complete: -7.238 -1.712 -0.45509 2.3614 5.698
  
  Coefficients:
                          Estimate Std. Error t value Pr(>|t|)    
  (Intercept):    Clean: -42.00028    7.08242  -5.930 4.98e-05 ***
               Complete: -39.91967   11.89600  -3.356  0.00375 ** 
                                                                  
     Air.Flow:    Clean:   0.95550    0.11018   8.672 9.15e-07 ***
               Complete:   0.71564    0.13486   5.307 5.80e-05 ***
                                                                  
   Water.Temp:    Clean:   0.55561    0.25128   2.211  0.04556 *  
               Complete:   1.29529    0.36802   3.520  0.00263 ** 
                                                                  
   Acid.Conc.:    Clean:  -0.11339    0.09821  -1.155  0.26904    
               Complete:  -0.15212    0.15629  -0.973  0.34405    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual Scale Estimates:
     Clean: 1.896 on 13 degrees of freedom
  Complete: 3.243 on 17 degrees of freedom
  
  Multiple R-squared:
     Clean: 0.9428 
  Complete: 0.9136 
  
  Correlations:
  Clean:
             (Intercept) Air.Flow Water.Temp
  Air.Flow    0.01                          
  Water.Temp -0.10       -0.61              
  Acid.Conc. -0.79       -0.40    -0.07     
  
  Complete:
             (Intercept) Air.Flow Water.Temp
  Air.Flow    0.18                          
  Water.Temp -0.15       -0.74              
  Acid.Conc. -0.90       -0.34     0.00     
  
  > 
  > pdf("fm2.pdf")
  > plot(fm2, 1)
  > plot(fm2, 2)
  > plot(fm2, 3)
  > plot(fm2, 4)
  > plot(fm2, 5)
  > plot(fm2, 6)
  > plot(fm2, 7)
  > plot(fm2, 8)
  > plot(fm2, 9)
  > dev.off()
  null device 
            1 
  > 
  > rm(fm2, fm2.sum)
  > file.remove("fm2.pdf")
  [1] TRUE
  > 
  > 
  > ################################################################################
  > # Test models with different formulas
  > ################################################################################
  > 
  > m1 <- lm(stack.loss ~ Air.Flow + Water.Temp, data = stackloss)
  > m2 <- lm(stack.loss ~ Water.Temp + Acid.Conc., data = stackloss)
  > fm3 <- fit.models(m1, m2)
  > print(fm3)
  
  Calls:
  m1: lm(formula = stack.loss ~ Air.Flow + Water.Temp, data = stackloss)
  m2: lm(formula = stack.loss ~ Water.Temp + Acid.Conc., data = stackloss)
  
  Coefficients:
     (Intercept) Air.Flow Water.Temp Acid.Conc.
  m1    -50.3588   0.6712     1.2954           
  m2    -51.2361              2.7320      0.129
  
  > print(fm3.sum <- summary(fm3, correlation = TRUE))
  
  Calls:
  m1: lm(formula = stack.loss ~ Air.Flow + Water.Temp, data = stackloss)
  m2: lm(formula = stack.loss ~ Water.Temp + Acid.Conc., data = stackloss)
  
  Residual Statistics:
         Min    1Q  Median    3Q   Max
  m1: -7.529 -1.75  0.1894 2.116 5.659
  m2: -7.820 -2.86 -0.6656 3.123 8.329
  
  Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
  (Intercept): m1: -50.3588     5.1383  -9.801 1.22e-08 ***
               m2: -51.2361    18.5374  -2.764  0.01279 *  
                                                           
     Air.Flow: m1:   0.6712     0.1267   5.298 4.90e-05 ***
               m2:                                         
                                                           
   Water.Temp: m1:   1.2954     0.3675   3.525  0.00242 ** 
               m2:   2.7320     0.3949   6.919 1.82e-06 ***
                                                           
   Acid.Conc.: m1:                                         
               m2:   0.1290     0.2329   0.554  0.58657    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual Scale Estimates:
  m1: 3.239 on 18 degrees of freedom
  m2: 5.137 on 18 degrees of freedom
  
  Multiple R-squared:
  m1: 0.9088 
  m2: 0.7704 
  
  Correlations:
  m1:
             (Intercept) Air.Flow
  Air.Flow   -0.31               
  Water.Temp -0.34       -0.78   
  
  m2:
             (Intercept) Water.Temp
  Water.Temp -0.03                 
  Acid.Conc. -0.91       -0.39     
  
  > 
  > pdf("fm3.pdf")
  > plot(fm3, 1)
  > plot(fm3, 2)
  > plot(fm3, 3)
  > plot(fm3, 4)
  > plot(fm3, 5)
  > plot(fm3, 6)
  > plot(fm3, 7)
  > plot(fm3, 8)
  > plot(fm3, 9)
  > dev.off()
  null device 
            1 
  > 
  > rm(fm3, fm3.sum)
  > file.remove("fm3.pdf")
  [1] TRUE
  > 
  > 
  > ################################################################################
  > # Test models with different formulas and different subsets
  > ################################################################################
  > 
  > m1 <- lm(stack.loss ~ Air.Flow + Water.Temp, data = stackloss, subset = -c(1, 2, 4, 21))
  > m2 <- lm(stack.loss ~ Water.Temp + Acid.Conc., data = stackloss)
  > fm4 <- fit.models(m1, m2)
  > print(fm4)
  
  Calls:
  m1: lm(formula = stack.loss ~ Air.Flow + Water.Temp, data = stackloss, 
      subset = -c(1, 2, 4, 21))
  m2: lm(formula = stack.loss ~ Water.Temp + Acid.Conc., data = stackloss)
  
  Coefficients:
     (Intercept) Air.Flow Water.Temp Acid.Conc.
  m1    -48.4451   0.9052     0.5367           
  m2    -51.2361              2.7320      0.129
  
  > print(fm4.sum <- summary(fm4, correlation = TRUE))
  
  Calls:
  m1: lm(formula = stack.loss ~ Air.Flow + Water.Temp, data = stackloss, 
      subset = -c(1, 2, 4, 21))
  m2: lm(formula = stack.loss ~ Water.Temp + Acid.Conc., data = stackloss)
  
  Residual Statistics:
         Min     1Q  Median     3Q   Max
  m1: -2.719 -1.486  0.2814 0.9865 4.136
  m2: -7.820 -2.860 -0.6656 3.1235 8.329
  
  Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
  (Intercept): m1: -48.4451     4.4107 -10.983 2.89e-08 ***
               m2: -51.2361    18.5374  -2.764   0.0128 *  
                                                           
     Air.Flow: m1:   0.9052     0.1024   8.839 4.21e-07 ***
               m2:                                         
                                                           
   Water.Temp: m1:   0.5367     0.2537   2.115   0.0528 .  
               m2:   2.7320     0.3949   6.919 1.82e-06 ***
                                                           
   Acid.Conc.: m1:                                         
               m2:   0.1290     0.2329   0.554   0.5866    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual Scale Estimates:
  m1: 1.918 on 14 degrees of freedom
  m2: 5.137 on 18 degrees of freedom
  
  Multiple R-squared:
  m1: 0.9369 
  m2: 0.7704 
  
  Correlations:
  m1:
             (Intercept) Air.Flow
  Air.Flow   -0.53               
  Water.Temp -0.24       -0.69   
  
  m2:
             (Intercept) Water.Temp
  Water.Temp -0.03                 
  Acid.Conc. -0.91       -0.39     
  
  > 
  > pdf("fm4.pdf")
  > plot(fm4, 1)
  > plot(fm4, 2)
  > plot(fm4, 3)
  > plot(fm4, 4)
  > plot(fm4, 5)
  > plot(fm4, 6)
  > plot(fm4, 7)
  > plot(fm4, 8)
  > plot(fm4, 9)
  > dev.off()
  null device 
            1 
  > 
  > rm(fm4, fm4.sum)
  > file.remove("fm4.pdf")
  [1] TRUE
  > 
  > 
  > ################################################################################
  > # Test simple linear regression
  > ################################################################################
  > 
  > fm5 <- fit.models(list(Robust = "rlm", LS = "lm"), stack.loss ~ Acid.Conc., data = stackloss)
  > print(fm5)
  
  Calls:
  Robust: rlm(formula = stack.loss ~ Acid.Conc., data = stackloss)
      LS: lm(formula = stack.loss ~ Acid.Conc., data = stackloss)
  
  Coefficients:
         (Intercept) Acid.Conc.
  Robust      -32.07      0.547
  LS          -47.96      0.759
  
  > print(fm5.sum <- summary(fm5, correlation = TRUE))
  
  Calls:
  Robust: rlm(formula = stack.loss ~ Acid.Conc., data = stackloss)
      LS: lm(formula = stack.loss ~ Acid.Conc., data = stackloss)
  
  Residual Statistics:
              Min     1Q  Median    3Q   Max
  Robust:  -8.649 -2.744  0.1617 2.446 25.35
      LS: -11.584 -5.584 -3.0659 1.247 22.42
  
  Coefficients:
                       Estimate Std. Error t value Pr(>|t|)  
  (Intercept): Robust: -32.0654    21.6292  -1.483           
                   LS: -47.9632    34.5044  -1.390   0.1806  
                                                             
   Acid.Conc.: Robust:   0.5474     0.2502   2.188           
                   LS:   0.7590     0.3992   1.901   0.0725 .
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual Scale Estimates:
  Robust: 4.037 on 19 degrees of freedom
      LS: 9.565 on 19 degrees of freedom
  
  Multiple R-squared:
      LS: 0.1599 
  
  Correlations:
  Robust:
             (Intercept)
  Acid.Conc. -1.00      
  
  LS:
             (Intercept)
  Acid.Conc. -1.00      
  
  > 
  > pdf("fm5.pdf")
  > plot(fm5, 1)
  > plot(fm5, 2)
  > plot(fm5, 3)
  > plot(fm5, 4)
  > plot(fm5, 5)
  > plot(fm5, 6)
  > plot(fm5, 7)
  > plot(fm5, 8)
  > plot(fm5, 9)
  > plot(fm5, 10)
  > dev.off()
  null device 
            1 
  > 
  > rm(fm5, fm5.sum)
  > file.remove("fm5.pdf")
  [1] TRUE
  > 
  > 
  > ################################################################################
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     3.01    0.09    3.11