<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 15.2 t 檢驗作為線性模型 t 檢驗是比較平均值的一種專用工具,但也可以看作是一般線性模型的一種應用。在這種情況下,模型如下所示: ![](https://img.kancloud.cn/03/a4/03a41e38a1959a74a7b9546e48fe19e2_198x21.jpg) 然而,吸煙是一個二元變量,因此我們將其作為一個 _ 虛擬變量 _,正如我們在上一章中討論的那樣,將其設置為吸煙者為 1,不吸煙者為零。在這種情況下,![](https://img.kancloud.cn/0a/ae/0aae65eceb0e309cde94947b99a24033_16x21.jpg)只是兩組之間平均值的差,![](https://img.kancloud.cn/e5/82/e58281243f77804ff2f8cb1273f51b5e_16x21.jpg)是編碼為零的組的平均值。我們可以使用`lm()`函數來擬合這個模型,并看到它給出與上面的 t 檢驗相同的 t 統計量: ```r # print summary of linear regression to perform t-test s <- summary(lm(TVHrsNum ~ RegularMarij, data = NHANES_sample)) s ``` ```r ## ## Call: ## lm(formula = TVHrsNum ~ RegularMarij, data = NHANES_sample) ## ## Residuals: ## Min 1Q Median 3Q Max ## -2.810 -1.165 -0.166 0.835 2.834 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 2.165 0.115 18.86 <2e-16 *** ## RegularMarijYes 0.645 0.213 3.02 0.0028 ** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 1.4 on 198 degrees of freedom ## Multiple R-squared: 0.0441, Adjusted R-squared: 0.0393 ## F-statistic: 9.14 on 1 and 198 DF, p-value: 0.00282 ``` 我們還可以以圖形方式查看 lm()結果(參見圖[15.2](#fig:ttestFig)): ![Violin plots showing data for each group, with a blue line connecting the predicted values for each group, computed on the basis of the results of the linear model.](https://img.kancloud.cn/30/c0/30c067abf9440bb99734f630f6c40835_384x384.png) 圖 15.2 顯示每組數據的小提琴圖,藍色線連接每組的預測值,根據線性模型的結果計算。 在這種情況下,不吸煙者的預測值為![](https://img.kancloud.cn/e5/82/e58281243f77804ff2f8cb1273f51b5e_16x21.jpg)(2.17),吸煙者的預測值為![](https://img.kancloud.cn/7e/fc/7efcaa3ce89002c5ed3259f899122dc7_56x21.jpg)(2.81)。 為了計算這個分析的標準誤差,我們可以使用與線性回歸完全相同的方程——因為這實際上只是線性回歸的另一個例子。事實上,如果將上述 t 檢驗中的 p 值與大麻使用變量的線性回歸分析中的 p 值進行比較,您會發現線性回歸分析中的 p 值正好是 t 檢驗中的 p 值的兩倍,因為線性回歸分析正在執行雙尾測試。 ### 15.2.1 比較兩種方法的效果大小 兩種方法之間比較最常用的效果大小是 Cohen's D(如您在第[10](#ci-effect-size-power)章中所記得的),它是用標準誤差單位表示效果的表達式。對于使用上文概述的一般線性模型(即使用單個虛擬編碼變量)估計的 t 檢驗,其表示為: ![](https://img.kancloud.cn/94/73/9473dd5dbf2464b1c6e052b25b6b21b6_109x45.jpg) 我們可以從上面的分析輸出中獲得這些值,得出 d=0.47,我們通常將其解釋為中等大小的效果。 我們也可以計算這個分析的![](https://img.kancloud.cn/7a/3a/7a3ac13e322417062b527547518a0df6_20x16.jpg),它告訴我們看電視的差異有多大。這個值(在 lm()分析的摘要中報告)是 0.04,這告訴我們,雖然效果在統計上有顯著意義,但它在電視觀看方面的差異相對較小。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看