Question Details

No question body available.

Tags

r intervals prediction nls

Answers (1)

Accepted Answer Available
Accepted Answer
April 29, 2025 Score: 2 Rep: 4,217 Quality: High Completeness: 80%

The culprit is assign(xname, newdata[, xname]) in here.

When there are two or more independent variables, the above code becomes assign(c('variable1','variable2'), newdata[, c('variable1','variable2')]). This does not make sense and the intended way is to assign them separately.

All we need to do is to replace the culprit with

for (i in 1:length(xname)) { assign(xname[i], newdata[, xname[i]]) }

The code is here:

predFit.nls