[R] Multi-variate rcs() error

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri May 1 00:04:23 CEST 2009


x wrote:
> Hi,
> 
> My code, output, error message, and sample data are all below. As always, all help is appreciated.
> 
> Code:
> ====
> library(Design); library(lattice)
> 
> df = read.table("./data_cub4.txt", header=TRUE, nrows=100)
> attach(df); dd = datadist(df); options(datadist = 'dd'); describe(df);
> 
> m = (y1 ~ ( rcs(x1,3) + rcs(x2,3) ) )
> f = ols(m, data=df)
> print(f)
> print( Function(f) )
> detach(df)
> 
> Output:
> ======
> Linear Regression Model ...
>          n Model L.R.       d.f.         R2      Sigma 
>        100      720.7          4     0.9993      82.44 
> Residuals:
>     Min      1Q  Median      3Q     Max 
> -113.21  -70.46  -20.09   65.77  214.77 
> Coefficients:
>            Value Std. Error         t Pr(>|t|)
> Intercept 757.85  1.647e+17 4.601e-15        1
> x1         35.58  9.080e+14 3.919e-14        1
> x1'        85.92  6.475e+14 1.327e-13        1
> x2            NA  1.797e+14        NA       NA
> x2'           NA  6.475e+14        NA       NA
> 
> Residual standard error: 82.44 on 95 degrees of freedom
> Adjusted R-Squared: 0.9992 
> 
> Error in if (coef[i] > 0 & (i > 2 | coef[1] != 0 | Intc != 0)) "+" else NULL : missing value where TRUE/FALSE needed
> 
> Sample data:
> =================
> config	benchmark	y1	x1	x2	noise
> 1	verify2	1008.2	1	1000	0.72
> 2	verify2	1019	2	999	1.6
> 

It just appears that you have perfect prediction, so you have quite an 
unusual dataset to be doing inference on.

Frank



-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list