<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 8.5 使用模擬統計:引導程序 到目前為止,我們已經使用模擬來演示統計原理,但是我們也可以使用模擬來回答實際的統計問題。在本節中,我們將介紹一個稱為 _ 引導程序 _ 的概念,它允許我們使用模擬來量化統計估計的不確定性。在本課程的后面部分,我們將看到模擬通常如何用于回答統計問題的其他示例,特別是當理論統計方法不可用或假設過于令人窒息時。 ### 8.5.1 計算引導程序 在上面的章節中,我們利用我們對平均值抽樣分布的了解來計算平均值和置信區間的標準誤差。但是如果我們不能假設這些估計是正態分布的,或者我們不知道它們的分布呢?引導的思想是使用數據本身來估計答案。這個名字來自于用自己的力量把自己拉起來的想法,表達了這樣一個想法:我們沒有任何外部的杠桿來源,所以我們必須依靠數據本身。自舉方法是由斯坦福統計局的布拉德利·埃夫隆構想的,他是世界上最有影響力的統計學家之一。 引導背后的想法是,我們從實際的數據集中重復采樣;重要的是,我們用替換的對 _ 進行采樣,這樣同一個數據點通常會在一個樣本中被多次表示。然后我們計算每個引導樣本的興趣統計,并使用這些估計的分布。_ 讓我們從使用引導程序來估計平均值的采樣分布開始,這樣我們就可以將結果與前面討論的平均值的標準誤差(sem)進行比較。 ```r # perform the bootstrap to compute SEM and compare to parametric method nRuns <- 2500 sampleSize <- 32 heightSample <- NHANES_adult %>% sample_n(sampleSize) bootMeanHeight <- function(df) { bootSample <- sample_n(df, dim(df)[1], replace = TRUE) return(mean(bootSample$Height)) } bootMeans <- replicate(nRuns, bootMeanHeight(heightSample)) SEM_standard <- sd(heightSample$Height) / sqrt(sampleSize) sprintf("SEM computed using sample SD: %f", SEM_standard) ``` ```r ## [1] "SEM computed using sample SD: 1.595789" ``` ```r SEM_bootstrap <- sd(bootMeans) sprintf("SEM computed using SD of bootstrap estimates: %f", SEM_bootstrap) ``` ```r ## [1] "SEM computed using SD of bootstrap estimates: 1.586913" ``` ![An example of bootstrapping to compute the standard error of the mean. The histogram shows the distribution of means across bootstrap samples, while the red line shows the normal distribution based on the sample mean and standard deviation.](https://img.kancloud.cn/12/a3/12a398bbf59ce2887019595225655b77_384x384.png) 圖 8.4 計算平均值標準誤差的引導示例。柱狀圖顯示平均值在引導樣本之間的分布,紅線顯示基于樣本平均值和標準差的正態分布。 圖[8.4](#fig:bootstrapSEM)顯示,基于正態性假設,引導樣本的平均值分布與理論估計值相當接近。我們也可以使用引導樣本計算平均值的置信區間,只需從引導樣本的分布計算感興趣的分位數。 ```r # compute bootstrap confidence interval bootCI <- quantile(bootMeans, c(0.025, 0.975)) pander("bootstrap confidence limits:") ``` 自舉置信限: ```r pander(bootCI) ``` <colgroup><col style="width: 13%"> <col style="width: 13%"></colgroup> | 2.5% | 98% | | --- | --- | | 164.634 年 | 170.883 個 | ```r # now let's compute the confidence intervals using the sample mean and SD sampleMean <- mean(heightSample$Height) normalCI <- tibble( "2.5%" = sampleMean - 1.96 * SEM_standard, "97.5%" = sampleMean + 1.96 * SEM_standard ) print("confidence limits based on sample SD and normal distribution:") ``` ```r ## [1] "confidence limits based on sample SD and normal distribution:" ``` ```r pander(normalCI) ``` <colgroup><col style="width: 13%"> <col style="width: 13%"></colgroup> | 2.5% | 97.5% | | --- | --- | | 164.575 年 | 170.831 個 | 我們通常不會使用引導程序來計算平均值的置信區間(因為我們通常可以假設正態分布適合平均值的抽樣分布,只要我們的樣本足夠大),但是這個例子顯示了該方法如何粗略地給出結果與基于正態分布的標準方法相同。在我們知道或懷疑正態分布不合適的情況下,引導程序更常被用來為其他統計數據的估計生成標準錯誤。
                  <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>

                              哎呀哎呀视频在线观看