Friday, 16 August 2013

Error in fitting Natural Spline in R

Error in fitting Natural Spline in R

I'm fitting a natural spline model and I get the errors below. Can you
help me understand and solve the error below?
Error in double(nx * ncoef) : vector size cannot be NA
In addition: Warning message: In nx * ncoef : NAs produced by integer
overflow
Unfortunately, I cannot upload the dataset and unfortunately, you could
not replicate my code. Instead, I'll try to explain my code as much as I
can:
Below is the code that I run to fit a natural spline fit:
fit.temp <- lm(y ~ ns(x,knots = seq(1, nrow(data), by = 10)),data = data)
In my dataset, x is a sequence from 1 to the number of rows in data which
is 424742.
I know this question is somewhat a vague question, but after spending a
lot of energy, I didn't have any luck figuring out what this error is and
how to solve it.
Thanks very much,

No comments:

Post a Comment