You need to create the variable names in newdata (which is generally a
dataframe) that match those used in constructing fm. Surely there
must be a worked example that illustrates this on the help page?
On Jul 29, 2009, at 9:30 AM, serbring wrote:
I have found a regression model, and i would like to predict value in
different points. I have tried to use predict function but it
doesn't work.
I have used predict function like this:
newdata<-seq(from=0.1, to=0.32,by=0.02)
data<-predict(fm,newdata)
where fm is a regression model. The predict function return me that:
Error in eval(predvars, data, env) : numeric argument 'envir'
doesn't have
unitary length
where is the error?
Hard to tell what other errors at work might be at work since no
reproducible example (and not even the original code to construct fm)
was offered. Please re-read the Posting Guide.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.