Skip to main content
Engineering LibreTexts

Chapter 8: F-Tests and Variable Independence

  • Page ID
    99732
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Here you can find a series of pre-recorded lecture videos that cover this content: https://youtube.com/playlist?list=PLSKNWIzCsmjDNUfe0P58VkcTtwIfxpSw2&si=Xrau1wfJKX8-ZI-k

    ​​Analyzing Samples Based on Variance

    We have previously discussed the \(\chi^2\) goodness of fit test but we want to build upon our ANOVA analysis which looked at analyzing populations based on variances and build upon that and introduce a new statistical tool, specifically the \(\chi^2\) test. Here our key test metric for this type of test

    \begin{equation}
    \chi^2 = \frac{(n-1)S^2}{\sigma_o^2}
    \end{equation}

    where σo is our null population standard deviation and S is our sample standard deviation previously defined. We can use this test just as we have for other statistical measures and for hypothesis testing as well, in fact let’s go ahead and work with our old material A and test to see if this sample comes from a population with a standard deviation of 1.31 GPa at a 95% confidence interval.

    \begin{eqnarray}
    H_{0}: \sigma = 1.31 GPa \\
    H_{a}: \sigma \neq 1.31 GPa \\
    \chi^2 = \frac{(n-1)S^2}{\sigma_o^2} =8.58\\
    \chi_{0.05,11}^{2} = 19.675
    \end{eqnarray}

    Here we can clearly see that we are in the do not reject regime. We can also see from our p-value is 0.68 which confirms we are in the reject regime.

    We can also compare whether material B comes from a population with a standard deviation greater than 1.7 GPa at a 99% confidence interval?

    \begin{eqnarray}
    H_{0}: \sigma = 1.7 GPa \\
    H_{a}: \sigma > 1.7 GPa \\
    \chi^2 = \frac{(n-1)S^2}{\sigma_o^2} =22.05\\
    \chi_{0.01,14}^{2} = 29.141
    \end{eqnarray}

    Here we can clearly see that we are in the do not reject regime. We can also see from our p-value is 0.078 which confirms we are in the reject regime.

    However, as we have demonstrated several times in this course we often want to make statements to compare samples and to do this we have to invoke the F-Test to compare variances/standard deviations.

    F-Test

    One can also perform hypothesis testing on multiple samples by examining variances and this can be done using the F-Test metric as defined below

    \begin{equation}
    F = \frac{S_1^2}{S_2^2}
    \end{equation}

    We can run a hypothesis test with this as well, let’s go ahead and keep examining our material A and B at a 95% confidence interval.

    \begin{eqnarray}
    H_{0}: \sigma_A^2 = \sigma_B^2 \\
    H_{a}: \sigma_A^2 \neq \sigma_B^2 \\
    F = \frac{S_A^2}{S_B^2} = 0.29 \\
    \end{eqnarray}

    We can look up the theoretical F value but we can see from the p-value of 0.04798 and we are in the do not reject region because this is a two-sided test so the critical p-value is 0.025.

    We can also run a test to see if the variance of A is smaller than B at a 90% confidence level

    \begin{eqnarray}
    H_{0}: \sigma_A^2 = \sigma_B^2 \\
    H_{a}: \sigma_A^2 < \sigma_B^2 \\
    F = \frac{S_A^2}{S_B^2} = 0.29 \\
    \end{eqnarray}

    We are in the reject region as the p-value is 0.02!

    \(\chi^2\) Test of Independence

    We can look for correlations between variables and specifically we can see whether variables are independent or dependent. The test works just the same as the goodness of fit test in that we will be comparing the observed frequencies to the expected frequencies.

    Typically when performing these types of test the data can will be reported in a table not too dissimilar to the one we can see here below

    process (1).jpg

    Figure \(\PageIndex{1}\): Material Processing Steps and Defects.

    Here we are looking at 500 samples and classifying if the sample exhibits a particular type of defect, 1-3. We also correlate that sample according to the type of material processing step that was undergone for that particular sample. Now one question

    that we may ask ourselves is if there is a correlation between the material process and the defect that occurs in the sample.

    We can then calculate the expected frequencies by multiplying the total number of observations for the row and the total number of observations for the column divided by the total number of observations.

    Thus we will be looking effectively at a probability and one can find the relationship that

    \begin{equation}
    \sum_{i_1}^r p_{ij} = 1
    \end{equation}

    where r is the number of rows and pij is the probability of obtaining an observation belonging to the ith row and jth column.

    Luckily, our \(\chi^2\) expression is similar with one caveat

    \begin{equation}
    \chi^{2} = \sum \limits_{i=1}^r \sum_{j}^c \frac{(O_{ij} - E_{ij})^2}{E_{ij}}
    \end{equation}

    where here \(r\) is the number of rows and \(c\) is the number of columns in our table. Additionally, our degrees of freedom \(\nu = (r-1)(c-1)\).

    Therefore we can perform our hypothesis testing procedures at a 95% confidence interval

    \begin{eqnarray}
    H_{0}: p_{ij} = \sum_{i=1}^c \sum_{j=1}^c p_{ij} \\
    H_{a}: p_{ij} \neq \sum_{i=1}^c \sum_{j=1}^c p_{ij} \\
    \chi^{2} = \sum \limits_{i=1}^r \sum_{j}^c \frac{(O_{ij} - E_{ij})^2}{E_{ij}} = 0.86404 \\
    \chi^{2}_{0.05,4} = 9.488
    \end{eqnarray}

    So we can see that we are in the Do Not Reject regime and our p-value confirms this as well!!

    We can also confirm this by hand calculations as well.


    Chapter 8: F-Tests and Variable Independence is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?