Skip to content
Prev 165436 / 398506 Next

newbie problem using Design.rcs

sp
Sincere thanks for both the replies.

0. I agree, I'm waiting for my copy of a regression book to arrive. Meanwhile, I'm trying to read on google.

1. My bad, I'm using Gaussian noise.

2. I didn't have x^3 b/c that co-efficient happens to be zero in this fitting.

3. I used lines() b/c I wanted to superimpose the curve from regression atop my first plot of the original data points (x,y). 
I'm not sure how to use plot(f, x1 = NA) after my first plot(). The examples I managed to find on google all use plot() followed by lines(). [In Matlab, I'd just say "hold" in between these calls.]

Also, I'm forced to call win.graph() before my first plot() to see the first plot. Is that normal?

4. I really could use some guidance on this part. I need to use rcs() to fit points in a high-dimensional space and I'm trying to understand and use it correctly. 

I started with testing it on just x,y dimensions so that I can visually evaluate the fitting. I tried y=x, y=x^2 etc, adding Gaussian noise each time (to the y). 

I plot original x,y and x,y' where y' is calculated using the co-efficients returned by rcs. I find that the regression curve differs from the actual points by as high as 10^5 with 3 knots and roughly -10^5 with 4 knots as I make y=x^2, y=x^3....

If this is NOT a good way to test fitting, could you pls tell me a better way?

Respectfully,
sp
--- On Tue, 12/23/08, Frank E Harrell Jr <f.harrell at vanderbilt.edu> wrote: