Solve Quick Mathematica Issue with HypothesisTesting

  • Context: Mathematica 
  • Thread starter Thread starter HJ Farnsworth
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
HJ Farnsworth
Messages
126
Reaction score
1
Greetings,

I have a nagging issue that keeps annoying me in Mathematica.

If a Mathematica function outputs a number I want in the form "variable→number", is there a function I could use or something simple I could type to get the number itself, rather than in the Root[variable, number] form?

Here's an example. I type:

Needs["HypothesisTesting`"]
a=NormalPValue[-2]

and Mathematica outputs:

OneSidedPValue → .0227501

I'm looking for a function f where, if I type:

f[a]

Then Mathematica will output:

.0227501

Thanks for any help you can give.

-HJ Farnsworth
 
Physics news on Phys.org
You need to de-reference it:

Needs["HypothesisTesting`"]
a = NormalPValue[-2]

myf[t_] := OneSidedPValue /. NormalPValue[t]
 
That worked, thank you.

-HJ Farnsworth