6879

Error converting rxGlm to GLM

Question:

I'm having a problem converting rxGlm models to normal glm models. Every time I try and covert my models I get the same error:

Error in qr.lm(object) : lm object does not have a proper 'qr' component. Rank zero or should not have used lm(.., qr=FALSE).

Here's a simple example:

cols <- colnames(iris) vars <- cols[!cols %in% "Sepal.Length"] form1 <- as.formula(paste("Sepal.Length ~", paste(vars, collapse = "+"))) rx_version <- rxGlm(formula = form1, data = iris, family = gaussian(link = 'log'), computeAIC = TRUE) # here is the equivalent model with base R R_version <- glm(formula = form1, data = iris, family = gaussian(link = 'log')) summary(as.glm(rx_version)) #this always gives the above error

I cant seem to find this "qr" component (I'm assuming this is related to matrix decomposition) to specify in rxGlm formula.

Anyone else dealt with this?

Answer1:

rxGlm objects don't have a qr component, and converting to a glm object won't create one. This is intentional, as computing the QR decomposition of the model matrix requires the full dataset to be in memory which would defeat the purpose of using the rx* functions.

as.glm is really meant more for supporting model import/export via PMML. Most of the things that you'd want to do can be done with the rxGlm object, without converting. Eg rxGlm computes the coefficient std errors as part of the fit, without requiring a qr component afterwards.

Recommend

  • filter and unfilter in dplyr
  • Preprocessing csv files to use with tflearn
  • Add a geom_rect to the plot background (not panel) in ggplot2
  • R do something after a warning (like tryCatch a warning, then edit an object)
  • How can I maintain a color scheme across ggplots, while dropping unused levels in each plot?
  • Export weka results on command line
  • Is there an apache pig equivalent of “SHOW TABLES”?
  • in R sort row data in ascending order
  • Birt script behaves differently via web viewer
  • ANOVA on multiple responses, by multiple groups NOT part of formula
  • Why is this piece of Javascript code so slow?
  • R replacing columns by lookup to dictionary
  • rename javascript object in order to use a php array
  • How to load an image in ASP.NET from a database as a file in a web browser?
  • How to bind Backbone model to jqGrid?
  • Reinitialise existing jQuery flexslider with new options
  • libcurl compile errors
  • How to delete column from range if cell contains specific value in VBA/Excel
  • How can I manually set the document id in a corpus?
  • What exactly is the height of modalPresentationStyle - FormSheet on iPad?
  • calculating number of bytes of each row in an image
  • Excel distinct count with conditions
  • Emacs lua-mode issue: (void-function interactively-called-p)
  • Want to understand iframe breakout code
  • Interpreting STRACE output - pipes and forks
  • c# open webrowser in many tab
  • Run multiple queries from 1 SQL file showing result in multiple tables
  • Xcode 4 NSLog Macro link in Xcode 3
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • Upload files with Ajax and Jquery
  • retrieve vertices with no linked edge in arangodb
  • AngularJs get employee from factory
  • Proper way to use connect-multiparty with express.js?
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • Change div Background jquery
  • apache spark aggregate function using min value
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • UserPrincipal.Current returns apppool on IIS
  • java string with new operator and a literal