[R] Multi-variate rcs() error
to_rent_2000 at yahoo.com
Sat May 2 04:55:03 CEST 2009
> > x wrote:
> > > x2 NA 1.797e+14 NA NA
> > > x2' NA 6.475e+14 NA
> > >
> > > Residual standard error: 82.44 on 95 degrees of
> > freedom
> > > Adjusted R-Squared: 0.9992
> > > Error in if (coef[i] > 0 & (i > 2 |
> > != 0 | Intc != 0)) "+" else NULL : missing
> > where TRUE/FALSE needed
> > It just appears that you have perfect prediction, so
> > have quite an unusual dataset to be doing inference
> > Frank
> OK, I tried different test datasets.
> 1) y1 <- rnorm(1000); x1 <- runif(1000); x2 <-
> does NOT show any error.
> 2) y1 = 10*x1*e1 + 10*x2*e1 + 100*e1 where x1=1..100,
> x2=100..1, e1=Gaussian noise
> gives me error like before.
> 3) y1 = x1^3*e1 + x2^3*e1 + 100*e1^2 also gives me the same
> Now, why should there be perfect prediction in cases 2
> & 3?
I tried another test - I replicated x1 to be x2 as well. While y1~rcs(x1,3) works y1~( rcs(x1,3) + rcs(x2,3) ) does not (error message shown above).
More information about the R-help