Skip to content
Back to formatted view

Raw Message

Message-ID: <76d2a74bd9.74bd976d2a@student.liu.se>
Date: 2001-06-20T13:26:15Z
From: tomsv193@student.liu.se
Subject: Error using lm(z~x+y,data)

Hi!

I am fitting a plane to a surface:

This works excellent:
---------------------------------
x<-dataframe[,1]
y<-dataframe[,2]
z<-dataframe[,3]
data<-cbind(x,y,z)

# Fit plane to surface
result<-lm(z~x+y,data)
---------------------------------

But I need to rescale the x,y parameters. So:
-----------------------------
x<-dataframe[,1]*149
y<-dataframe[,2]*149
z<-dataframe[,3]
data<-cbind(x,y,z)

# Fit plane to surface
result<-lm(z~x+y,data)
----------------------------------

And surprisingly this does not work. Error message is:

Error in eval(attr(formula, "variables"), data, env) : 
        sys.frame: not that many enclosing functions

Why does this happen?


kind regards
Tomas Svensson
EVOTEC,Hamburg


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._