# p-value for nonlinear equation

For example I have vectX and vectY, and I want to know:

1. Which is the better model fitting for my data -- it can be linear, exponential, or parabolic.
2. If my result is significant.

I am doing it like this:

#response exponentiel
expFct2 = function (x, a, b,c)
{
a*(1-exp(-x/b)) + c
}
#response parabola
expFct3 <- function (x, a, b, c)
{
a*x^2+b*x+c
}

model1 <- lm(vectY ~ vectY, data=d)
aic1 <- AIC(model1)

model2 <- nls(vectY ~ expFct2(vectX, a, b, c), data= d,
aic2 <- AIC(model2)

model3 <- nls(vectY ~ expFct3(vectX, a, b, c), data= d,
start = list(a=-1, b=3, c=0))
aic3 <- AIC(model3)

if ((aic1 <= aic2) & (aic1 <= aic3)) print("Model1 is better")
if ((aic2 < aic1) & (aic2 < aic3)) print("Model2 is better")
if ((aic3 < aic1) & (aic3 < aic2))print("Model3 is better")


For example if model1 is better, I am doing summary(model1) and I have p-value to know if my result is significant. And I built my equation from de coeff

But if it is model 2, non linear is better. I'am doing summary(model2) but there isn't p-value. I read that it is normal. So how can I know if my result is significant? I still can built an equation but if it isn't significant...

Is it possible to do cor.test(vectX,vectY) before knowing which is the better model? And if p-value is > 0.05 then I don't need to cheek what is the better model, because it isn't significant?

-

You are trying to substitute rules and computations for thinking.

The cor.test approach will not work because cor.test only tests linear relationships, there are many examples of curved relationships (parabola being one) where cor.test would show no relationship when there is one.

What does the science behind your variables suggest as a reasonable relationship? Do all match with intuition?

Which AIC score is lowest is not enough, what if one is lower but by only a miniscule amount? It would probably not be hard to find/create a sample dataset where moving a single point by a small amount would change which of your AIC scores is the lowest, would you really be comfortable with a decision based on rules like that?

Also note that your parabola can be fit as a linear model using lm rather than nls. Also note that AIC is defined up to a constant, make sure that the aic methods for lm and nls use the same constant or the comparisons will be meaningless.

-
Thank you for your answer. My data is really big and and I have to choose one of this equations for about 100 difference vectX and vectY. So I can't check every couple of vectors. Is there another method to determine which is the better model? Can I use summary(model)\$sigma For nls function, how can I know if my equation is significance? – Tali Sep 17 '11 at 20:13
@Tatiana This is not a forum; please follow the rules described in FAQ. – mbq Sep 17 '11 at 22:20