4
$\begingroup$

I've been using the lm function in R to do demand modeling (tons of steel to be predicted by various economic indicators). I used $R^2$ and $F$ to report on the strength of the model. However, when I use the R function lqs ("resistant regression") and then type in summary(model_name) I do not get any statistics that I can use to report on the strength of the regression model. Any suggestions?

EDIT: Thanks for your quick response. I don't have a problem with lqs(). The problem is that when I type in summary(Model) I do not get any goodness of fit information (e.g., adjusted R squared) as I do when I enter summary(x) where X is a model created using the lm function. I'd like to have something to show the strength of the model. I"m using MASS. See below.

library(MASS)

M10 = lqs(agri ~ p12 + p1 + p11 + p5 + p8 + p6 + p25 + p50 + p35,
          data = agri_data2) 
summary(M10) 
Length Class Mode
crit 1 -none- numeric
sing 1 -none- character coefficients 10 -none- numeric
bestone 10 -none- numeric
fitted.values 103 -none- numeric
residuals 103 -none- numeric
scale 2 -none- numeric
terms 3 terms call
call 3 -none- call
xlevels 0 -none- list
model 10 data.frame list 
$\endgroup$
1
  • 1
    $\begingroup$ @williamyarberry Register here and on maths with the same OpenID to recover the ownership of your question (if you think it is worth it, of course ;-) ). You can do it by clicking "log in" at the top bar. $\endgroup$
    – user88
    Feb 28, 2011 at 20:31

2 Answers 2

4
$\begingroup$

Try typing:

model_name

Based on a quick skim of the lqs() documentation in the MASS package this looks like it should work. If it doesn't work and you're not using MASS, please specify which library you're running lqs() from (and maybe even point to the documentation if you want to make everybody's life easier).

$\endgroup$
2
  • $\begingroup$ In response to your edit, @williamyarberry, I apologize for not realizing what exactly you meant by the original question. I've been poking around in the documentation for MASS and I'm also uncertain why the output doesn't provide any summary information about model fit. Presumably, you could use the fitted.values and residuals stored in the M10 object to calculate $R^2$ independently, but I do not know if that's a sensible approach with this method. $\endgroup$
    – ashaw
    Mar 1, 2011 at 3:26
  • 1
    $\begingroup$ I should note that a general point common to many Robust/Resistant techniques (I've mostly worked with Huber estimators) is that they require you to bootstrap standard errors & $R^2$ values. Two discussions I found useful in my searches on this topic (and which contain code for bootstraping standard errors for an lqs model) can be found here and here (PDF). I also recommend exploring the sources cited in the MASS documentation. $\endgroup$
    – ashaw
    Mar 1, 2011 at 3:43
0
$\begingroup$

The model (M10) has lots of stored information in a list. Using summary(M10), you only get some of it.

If you were to do this at the command line:

M10[[3]]

you would get the intercept and the slope of the linear model returned.

$\endgroup$
1
  • $\begingroup$ This is short for our standards, can you try to augment this answer making it so more useful&informative? $\endgroup$ Mar 20, 2020 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.