Skip to content

basic question about lm summaries

2 messages · andy bernat, Brian Ripley

#
I'm very new to R and I'm having trouble doing something that should be
very simple (so I'm probably missing something quite obvious).  When I
run
I get the correct coefficients.  However, when I try to get anything
else out of this I get a message about a missing argument, e.g.:
Error: Argument "n" is missing, with no default
None of the documentation mentions this argument "n", though I notice
that there is a variable "n" in the function definition.  My apologies
if this seems like too basic a question but any assistance is greatly
appreciated.
Regards,
Andy Bernat
P.S. I'm using the rw0640 binaries for windows 95.





-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Thu, 22 Apr 1999, andy bernat wrote:

            
You need to find out where that error message is coming from, by 
traceback(). The documentation for the function giving the error
probably mentions n.

I won't try to solve the problem (you need to send us an example to
reproduce), but I will try to help make using R easier.

-- use  lm(CRIME ~ INCOME + HOUSING, data=data). That is easier to read
   (it would be even easier without the capitals) and ensures that the
   variables are searched for in `data', which I hope is a data frame (but
   lists work too, I believe).

-- Don't ever call methods unless you mean to do something very unusual. Do
   summary(lm(CRIME ~ INCOME + HOUSING, data=data))

-- Unless you really need them, avoid assignments as arguments. They are
   hard to read and easy to miss when skimming code. In other words, use

   lm.d1 <- lm(data$CRIME~data$INCOME+data$HOUSING)
   summary(lm.d1)

-- Try the opposite convention, d1.lm. Names with a system name . something 
   are normally either methods or helper functions.  And surely it is the
   data that is important here, not lm.

-- Avoid names like `data'.  One guess as to the root of your problem is
   that another object named `data' (other than the one you meant) is 
   being found. Now, some analysis suggests that is unlikely, but if the 
   data frame had been called `UScrime' I would have had no analysis to do.