Changeset 859

Show
Ignore:
Timestamp:
12/08/11 16:03:48 (18 months ago)
Author:
jjr8
Message:

Fixed #506: When model includes only one term, Fit GLM tool fails with RPy_RException: Error in vif(model) : model contains fewer than 2 terms

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MGET/Branches/Jason/PythonPackage/src/GeoEco/Statistics/SummarizeModel.r

    r827 r859  
    3131                   sep="") 
    3232    } 
    33     else 
     33    else    # It is a GLM. 
    3434    { 
    3535        vif <- function (mod, ...)  
     
    6565        } 
    6666 
    67         s = c(capture.output(summary(model), anova(model)), "", "Variance Inflation Factors:", "", capture.output(print(vif(model)))) 
     67        if (length(labels(terms(model))) >= 2) 
     68            s = c(capture.output(summary(model), anova(model)), "", "Variance Inflation Factors:", "", capture.output(print(vif(model)))) 
     69        else 
     70            s = c(capture.output(summary(model), anova(model))) 
    6871    } 
    6972