The P-value of a graph is a measure used in statistics that indicates how likely it is that the data on a graph could have occurred by chance or is a consistent result.
2024-10-30
The P-value of a graph is a measure used in statistics that indicates how likely it is that the data on a graph could have occurred by chance or is a consistent result.
In order to calculate the P-value, there are a few steps that we must follow in order to get an accurate measure. Here we’ll break it down into 2 parts.
1- calculating the F-statistic
2- Use the F-statistic to find the P-value.
Below we’ll calculate the first step:
\[
F = \frac{\text{MS}_{\text{model}}}{\text{MS}_{\text{residual}}}
\] where
- \(\text{MS}_{\text{model}}\) is the mean square of the model (explained variance)
- \(\text{MS}_{\text{residual}}\) is the mean square of the residuals (unexplained variance)
Once we found the F-statistic, we have all the tools we need to calculate the P-value. There are a few pieces of information that are important to understand to fully grasp the equation, they are:
degrees of freedom
- df1 = the number of groups - 1
- df2 = total observations - number of groups
F-distribution CDF
- Calculates the probability of observing an F-statistic similar to the observed value (uses df1 & df2)
we take this information and plug it into the the following formula:
\[
\text{p-value} = P(F > F_{\text{observed}}) = 1 - \text{CDF}_{F(\text{df}_1, \text{df}_2)}(F_{\text{observed}})
\] The function “pf()” performs this calculation for us, see the next slide for an example.
Here is code used to create a 3D graph in the next slide, looking closely we can see the pf() function in action.
It can and should be noted that for this graph, the P-value is too good, which should also be treated as suspect. Much like in machine learning, there is such a thing as “Over fitting”
This P-value is in an acceptable range and can be treated as accurate, showing that there is a correlation between solar radiation levels and the earth’s temperature.
Thanks for taking the time to Look through this Presentation!