1 / 11

Stata 教學

Stata 教學. 第三講 Recode 、 missing value 、假設檢定與信賴區間. 相關 Stata 指令. 打開 88q1-culture.dta 這個社會變遷基本資料調查第三期第五次文化價值的 Stata 資料檔 因為中文相容性問題有一些亂碼,辨識不易 可以打開 88q1_format.txt 看變數名稱以及變數值名稱 以 v26a 為例 此題問受訪者「 26a. 您認為中國悠久的文化值得驕傲嗎?」.

Télécharger la présentation

Stata 教學

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stata教學 第三講 Recode、missing value、假設檢定與信賴區間 社會統計

  2. 相關Stata指令 • 打開88q1-culture.dta這個社會變遷基本資料調查第三期第五次文化價值的Stata資料檔 • 因為中文相容性問題有一些亂碼,辨識不易 • 可以打開88q1_format.txt看變數名稱以及變數值名稱 • 以v26a為例 • 此題問受訪者「26a.您認為中國悠久的文化值得驕傲嗎?」 社會統計

  3. 回答1"很值得驕傲" 2"值得驕傲" 3"不太值得驕傲" 4"不值得驕傲" 5"無意見" 6"不知道" 8"不瞭解題意" 9"不願意回答" 0"缺漏“ • 我們想要了解回答的次數分佈 • tabulate v26a • 下面Stata的結果均經過編輯,以修改亂碼。 社會統計

  4. 26a.您認為中 國悠久的文化 值得驕傲嗎? Freq. Percent Cum. 很值得驕傲 365 18.74 18.74 值得驕傲 949 48.72 67.45 不太值得驕傲 238 12.22 79.67 不值得驕傲 109 5.60 85.27 沒意見 178 9.14 94.40 不知道 72 3.70 98.10 不瞭解題意 22 1.13 99.23 不願意回答 15 0.77 100.00 Total 1,948 100.00 需要重新排序,很值得驕傲得5分,沒意見3分,不值得驕傲為1分 和0一起界定為missing 社會統計

  5. Stata如何重新定義變數值 • recode v26a (1=5)(2=4)(5=3)(3=2)(4=1)(0 6/max=.) • (0 6/max=.)是把0和6以上(包含6)以上到最大值都界定為缺失值missing value以英文的句點.來代表(Stata認定.是系統定義的缺失值) 社會統計

  6. tabulate v26a 社會統計

  7. 26a.您認為中 國悠久的文化 值得驕傲嗎? Freq. Percent Cum. 不值得驕傲 109 5.93 5.93 不太值得驕傲 238 12.94 18.87 沒意見 178 9.68 28.55 值得驕傲 949 51.60 80.15 很值得驕傲 365 19.85 100.00 Total 1,839 100.00 *注意:變數標籤並沒有轉換,例如答案為1的仍然是「很值得驕傲」、2為「值得驕傲」,所以要自行注意調整 社會統計

  8. 假設檢定的步驟 • 設立虛無假設與對立假設 • 選擇檢定統計量 • 選擇顯著水準及決定決策法則 • 比較樣本檢定統計量與檢定統計量 • 結論 社會統計

  9. 假設檢定 • H0:μ=3 • ttest v26a == 3 • 或用Statistics>Summaries, tables, and tests>Classical tests of hypotheses>one-sample mean comparison test 社會統計

  10. 社會統計

  11. 3.665035±t0.025(0.025913) =1.11124/√1839 (3.665035-3)/0.025913 One-sample t test ------------------------------------------------------------------------------ Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- v26a | 1839 3.665035 .025913 1.11124 3.614213 3.715857 ------------------------------------------------------------------------------ mean = mean(v26a) t = 25.6642 Ho: mean = 3 degrees of freedom = 1838 Ha: mean < 3 Ha: mean != 3 Ha: mean > 3 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000 兩個單尾檢定的p值 均數≠3的對立假設p值 1839-1 社會統計

More Related