2

I'm currently having issues trying to plot a linear regression done with ols() in R.

My code is:

library(languageR)
library(rms)

english.dd = datadist(english)

options(datadist = "english.dd")

english.ols = ols(RTlexdec  ~ WrittenFrequency + LengthInLetters, english)

plot(english.ols)

## Error en match.arg(type) : 
##   'arg' should be one of “ordinary”, “score”, “dfbeta”, “dfbetas”, “dffit”,  “dffits”, “hat”, “hscore”

## Calls: plot ... weighted.residuals -> residuals -> residuals.ols -> match.arg

I don't know how to resolve the problem, I've been looking for solutions online but I couldn't find any.

Thanks for your help.

mnel
  • 113,303
  • 27
  • 265
  • 254

1 Answers1

1

When I run

plot(Predict(english.ols))

I get: enter image description here

There are many other examples in ?plot.Predict

Seth
  • 4,745
  • 23
  • 27
  • I don't need to plot the Predict(), that one works well, I need to plot the regression model that shows how each predictor influence the dependent variable. – Matías Guzmán Naranjo Jul 31 '12 at 10:28
  • I don't follow. It seems like the plot I show above shows the estimate of the effect of each predictor on the dependent variable, with confidence bound. Do you want to see the diagnositic plots of residuals vs fitted? rediduals vs normal curve? – Seth Jul 31 '12 at 16:00
  • I was wrong, I'm sorry, that's exactly what I needed :) Thank you very much. – Matías Guzmán Naranjo Aug 01 '12 at 09:44