Re: Converting confidence interval to p value
- From: "Tom Lane" <tlane@xxxxxxxxxxxxx>
- Date: Mon, 30 Nov 2009 17:59:27 -0500
I'm using lsqcurvefit to fit a non-linear model to my time series data.
The command looks like this:
%Fitting:
[beta,resnorm,r,e,o,l,J]=lsqcurvefit('mymodel',[1 200], ti,data,[0 0],[3
1000],options,tau);
% Compute confidence interval:
ci = nlparci(beta,r,'jacobian',J);
Can someone tell me what steps to take from here to represent the
"goodness of fit" as a statistic, like a p-value?
Brad, you want a p-value for testing what?
Perhaps you want to test whether your fitted model fits better than a
simpler model that is a special case. For example, the model where the
response (y) variable is constant may be a special case of your model with
parameter set to certain values, and you may wonder whether your model is an
improvement over that.
Are any of your parameter estimates at the lower or upper bounds you
entered? If so, that would likely invalidate any of the ideas I'll try to
give here. I'm going to be sketchy with the details, but I may be able to
provide more information if I understand better what you want.
1. You could fit the simpler model and measure the increase in sum of
squares compared with your model. Then you could do an F test. Standard
references should provide information about how to do that.
2. You could use the J and r values to compute an estimate of the
covariance matrix for the coefficient estimates. Then you could use the
linhyptest function to test whether the true coefficient values (or a subset
of them) could be equal to specific values that you specify.
3. Suppose one of your parameters is just a constant term, and the other is
the one you're really interested in testing. Then a test just on that
parameter may be what you need. You could adjust the 'alpha' input to
nlparci until the confidence interval endpoint just touches the value that
interests you, say the value 0. Then you could use that as your p-value.
On reason I am vague is because I don't understand what type of function you
are fitting and what type of test you want. So I don't even know if you'd
want to test one or both parameters.
One last thing. You mention "goodness of fit" statistic. People use that
phrase in various ways, but not usually to describe a p-value for testing a
regression. Sometimes they mean something like R-square. You can compute
that easily by applying the definition, using the sum of squares of r and
the sum of squared deviations of "data" from its mean. Other times they mean
a statistic that might, for example, measure how well the residuals seem to
follow a normal distribution.
If this doesn't help, I'd welcome more details about what you need.
-- Tom
.
- Follow-Ups:
- Re: Converting confidence interval to p value
- From: Brad M
- Re: Converting confidence interval to p value
- Prev by Date: Re: vectorization - grayscale arraylut?
- Next by Date: Re: vectorization - grayscale arraylut?
- Previous by thread: Why is MOVEFILE so slow?
- Next by thread: Re: Converting confidence interval to p value
- Index(es):
Relevant Pages
|