Re: How to compute p-value



Konrad Viltersten wrote:
I'd like to compute the p-value for a certain distribution.
Let's say i have the following:
val = cdf ('chi2', spot, 99)
which allows me to simply check what cdf we have
accumulated in the point of spot.

Now, i wish to go the other way around and given the value
of val, get the corresponding value of spot.

Presumably you have the Statistics Toolbox, since you're using CDF. For every function named something like CHI2CDF (which is what CDF('chi2',...) ultimately calls, there is a function named something like CHI2INV to compute a quantile given a cumulative probability. The opposite of CDF is named ICDF (because INV is a linear algebra function).


Neither of these two things is a p-value, probably. Usually for a chi-square distribution, the p-value that people care about is the right tail, which you get from 1-chi2cdf(spot,99).

Hope this helps.

- Peter Perkins
  The MathWorks, Inc.
.



Relevant Pages

  • How to compute p-value
    ... I'd like to compute the p-value for a certain distribution. ... which allows me to simply check what cdf we have ... get the corresponding value of spot. ...
    (comp.soft-sys.matlab)
  • Re: How to compute p-value
    ... get the corresponding value of spot. ... > Presumably you have the Statistics Toolbox, since you're using CDF. ... > linear algebra function). ... > Neither of these two things is a p-value, ...
    (comp.soft-sys.matlab)
  • Re: Finding the p-value using MatLab
    ... i seem to have big time trouble finding the right tools for that. ... val = cdf ('chi2', spot, 99) which allows me to simply check what cdf we have accumulated in the point of spot. ... I hope you dance -- Lee Ann Womack ...
    (sci.stat.math)
  • Re: TDist Formula and Explanation
    ... tdist function to come up with the p-value. ... Excel's tdist is not the cdf of t, ... Suippose t is negative and you want the probability ...
    (sci.stat.math)
  • Re: TDist Formula and Explanation
    ... tdist function to come up with the p-value. ... minus the cdf of the absolute value of t. ...
    (sci.stat.math)

Loading