Why do you use Z statistics instead of T for inference on categorical variables?












0












$begingroup$


If I'm comparing the difference between two proportions, why do I use the Z statistic instead of a T statistic? I thought T statistics were used when you don't know the true standard deviation in a population - why doesn't this apply for differences in standard deviations of the samples taken?










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    If I'm comparing the difference between two proportions, why do I use the Z statistic instead of a T statistic? I thought T statistics were used when you don't know the true standard deviation in a population - why doesn't this apply for differences in standard deviations of the samples taken?










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      If I'm comparing the difference between two proportions, why do I use the Z statistic instead of a T statistic? I thought T statistics were used when you don't know the true standard deviation in a population - why doesn't this apply for differences in standard deviations of the samples taken?










      share|cite|improve this question









      $endgroup$




      If I'm comparing the difference between two proportions, why do I use the Z statistic instead of a T statistic? I thought T statistics were used when you don't know the true standard deviation in a population - why doesn't this apply for differences in standard deviations of the samples taken?







      statistics statistical-inference






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 31 at 14:37









      zacpolzacpol

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Basically it comes down to hypothesis testing. If you have a sample of $n$ Bernoulli($p$) variables $X_i$ with unknown $p$, you take the null hypothesis $p=hat{p}=overline{X}$, and then you compute tail probabilities (depending on what the alternative hypothesis is). But because you know $p$, you can exactly compute these tail probabilities using the binomial distribution. You don't need to know any other parameters to do these computations, just $p$.



          The $T$ statistic strictly speaking is only correct for normally distributed data, but it arises because in the normal distribution, the mean and variance are independent parameters. That means that assuming $mu=overline{X}$ alone does not allow you to compute tail probabilities. You need to either estimating the variance or additionally include the variance in the null hypothesis (and we rarely want to do the latter). But when we estimate the variance, the error that we make changes the distribution of the test statistic so that it isn't normal anymore. Using the $t$ distribution instead corrects for this error.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
            $endgroup$
            – zacpol
            Feb 2 at 13:10










          • $begingroup$
            for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
            $endgroup$
            – zacpol
            Feb 2 at 13:11










          • $begingroup$
            @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
            $endgroup$
            – Ian
            Feb 2 at 14:40














          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3094953%2fwhy-do-you-use-z-statistics-instead-of-t-for-inference-on-categorical-variables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0












          $begingroup$

          Basically it comes down to hypothesis testing. If you have a sample of $n$ Bernoulli($p$) variables $X_i$ with unknown $p$, you take the null hypothesis $p=hat{p}=overline{X}$, and then you compute tail probabilities (depending on what the alternative hypothesis is). But because you know $p$, you can exactly compute these tail probabilities using the binomial distribution. You don't need to know any other parameters to do these computations, just $p$.



          The $T$ statistic strictly speaking is only correct for normally distributed data, but it arises because in the normal distribution, the mean and variance are independent parameters. That means that assuming $mu=overline{X}$ alone does not allow you to compute tail probabilities. You need to either estimating the variance or additionally include the variance in the null hypothesis (and we rarely want to do the latter). But when we estimate the variance, the error that we make changes the distribution of the test statistic so that it isn't normal anymore. Using the $t$ distribution instead corrects for this error.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
            $endgroup$
            – zacpol
            Feb 2 at 13:10










          • $begingroup$
            for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
            $endgroup$
            – zacpol
            Feb 2 at 13:11










          • $begingroup$
            @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
            $endgroup$
            – Ian
            Feb 2 at 14:40


















          0












          $begingroup$

          Basically it comes down to hypothesis testing. If you have a sample of $n$ Bernoulli($p$) variables $X_i$ with unknown $p$, you take the null hypothesis $p=hat{p}=overline{X}$, and then you compute tail probabilities (depending on what the alternative hypothesis is). But because you know $p$, you can exactly compute these tail probabilities using the binomial distribution. You don't need to know any other parameters to do these computations, just $p$.



          The $T$ statistic strictly speaking is only correct for normally distributed data, but it arises because in the normal distribution, the mean and variance are independent parameters. That means that assuming $mu=overline{X}$ alone does not allow you to compute tail probabilities. You need to either estimating the variance or additionally include the variance in the null hypothesis (and we rarely want to do the latter). But when we estimate the variance, the error that we make changes the distribution of the test statistic so that it isn't normal anymore. Using the $t$ distribution instead corrects for this error.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
            $endgroup$
            – zacpol
            Feb 2 at 13:10










          • $begingroup$
            for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
            $endgroup$
            – zacpol
            Feb 2 at 13:11










          • $begingroup$
            @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
            $endgroup$
            – Ian
            Feb 2 at 14:40
















          0












          0








          0





          $begingroup$

          Basically it comes down to hypothesis testing. If you have a sample of $n$ Bernoulli($p$) variables $X_i$ with unknown $p$, you take the null hypothesis $p=hat{p}=overline{X}$, and then you compute tail probabilities (depending on what the alternative hypothesis is). But because you know $p$, you can exactly compute these tail probabilities using the binomial distribution. You don't need to know any other parameters to do these computations, just $p$.



          The $T$ statistic strictly speaking is only correct for normally distributed data, but it arises because in the normal distribution, the mean and variance are independent parameters. That means that assuming $mu=overline{X}$ alone does not allow you to compute tail probabilities. You need to either estimating the variance or additionally include the variance in the null hypothesis (and we rarely want to do the latter). But when we estimate the variance, the error that we make changes the distribution of the test statistic so that it isn't normal anymore. Using the $t$ distribution instead corrects for this error.






          share|cite|improve this answer









          $endgroup$



          Basically it comes down to hypothesis testing. If you have a sample of $n$ Bernoulli($p$) variables $X_i$ with unknown $p$, you take the null hypothesis $p=hat{p}=overline{X}$, and then you compute tail probabilities (depending on what the alternative hypothesis is). But because you know $p$, you can exactly compute these tail probabilities using the binomial distribution. You don't need to know any other parameters to do these computations, just $p$.



          The $T$ statistic strictly speaking is only correct for normally distributed data, but it arises because in the normal distribution, the mean and variance are independent parameters. That means that assuming $mu=overline{X}$ alone does not allow you to compute tail probabilities. You need to either estimating the variance or additionally include the variance in the null hypothesis (and we rarely want to do the latter). But when we estimate the variance, the error that we make changes the distribution of the test statistic so that it isn't normal anymore. Using the $t$ distribution instead corrects for this error.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 31 at 14:58









          IanIan

          68.9k25392




          68.9k25392












          • $begingroup$
            Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
            $endgroup$
            – zacpol
            Feb 2 at 13:10










          • $begingroup$
            for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
            $endgroup$
            – zacpol
            Feb 2 at 13:11










          • $begingroup$
            @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
            $endgroup$
            – Ian
            Feb 2 at 14:40




















          • $begingroup$
            Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
            $endgroup$
            – zacpol
            Feb 2 at 13:10










          • $begingroup$
            for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
            $endgroup$
            – zacpol
            Feb 2 at 13:11










          • $begingroup$
            @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
            $endgroup$
            – Ian
            Feb 2 at 14:40


















          $begingroup$
          Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
          $endgroup$
          – zacpol
          Feb 2 at 13:10




          $begingroup$
          Thank you - so you're saying that T is only used when you need to correct for variance in a sample? My question now is why you can assume you know p? Maybe I'm missing a part of your explanation that you can point out to me more explicitly.
          $endgroup$
          – zacpol
          Feb 2 at 13:10












          $begingroup$
          for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
          $endgroup$
          – zacpol
          Feb 2 at 13:11




          $begingroup$
          for example: a paper discussed the proportion of pts who experienced tumor regrowth w/in 5 years of complete vs subtotal resection. 42/64 of the subtotal pts experienced regrowth, while only 23/65 of the total pts experienced regrowth. They reported the p value based on the Z statistic calculated by the difference in the two proportions (0.30) compared to the null (0) divided by the SE of the pooled distribution (0.088). I follow the methods, but not the assumption that you can know the true proportion of recurrence in the population. Is this based on some property of bernoulli distributions?
          $endgroup$
          – zacpol
          Feb 2 at 13:11












          $begingroup$
          @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
          $endgroup$
          – Ian
          Feb 2 at 14:40






          $begingroup$
          @zacpol It's not that you do know $p$, it's that when you're testing a hypothesis about the value of $p$, you assume a value of $p$ according to the null hypothesis and then compute probabilities based on that assumption. In the case of the binomial distribution this fully allows you to compute probabilities. In the case of the normal distribution it does not because the variance is still unknown, and then estimating the variance distorts the distribution.
          $endgroup$
          – Ian
          Feb 2 at 14:40




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3094953%2fwhy-do-you-use-z-statistics-instead-of-t-for-inference-on-categorical-variables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

          How to fix TextFormField cause rebuild widget in Flutter