
<aside> 💡 兩組,使用t檢定(t-test)。 三組與三組以上,使用「變異數分析」(ANOVA: ANalysis Of VAriance)
</aside>
. tab gender_e gender_s, chi2
Employee |
Gender | Supervisor Gender
(Employee | (Supervisor Rated,
Rated, | Time 1)
Time 1) | 1.0 2.0 | Total
-----------+----------------------+----------
1 | 36 43 | 79
2 | 15 68 | 83
-----------+----------------------+----------
Total | 51 111 | 162
Pearson chi2(1) = 14.1876 Pr = 0.000
* 性別組合並非隨機。意即主管性別、員工性別兩者的組合,並不獨立。
* Contingency Table 由「列聯表」中可見:同性組合較高。(1/1和2/2)
.
. tab gender_e gender_s, chi2 column
+-------------------+
| Key |
|-------------------|
| frequency |
| column percentage |
+-------------------+
Employee |
Gender | Supervisor Gender
(Employee | (Supervisor Rated,
Rated, | Time 1)
Time 1) | 1.0 2.0 | Total
-----------+----------------------+----------
1 | 36 43 | 79
| 70.59 38.74 | 48.77
-----------+----------------------+----------
2 | 15 68 | 83
| 29.41 61.26 | 51.23
-----------+----------------------+----------
Total | 51 111 | 162
| 100.00 100.00 | 100.00
Pearson chi2(1) = 14.1876 Pr = 0.000
. chi2 卡方值=14.19, p<-.01

以下使用Study_2a資料 Study 2a以實驗法進行研究 研究參與者扮演員工,閱讀上司給該員工的電子郵件。 研究設計中,透過郵件的內容,操弄了上司UPB(在組織中不道德行為)的程度的高低。 該研究者自評其在某工作決策上的UPB分數。 變數名 upb_manipulation

兩組,使用t檢定(t-test)。 三組與三組以上,使用「變異數分析」(ANOVA: ANalysis Of VAriance)
<aside> 💡 研究假說一 主管的UPB,對員工UPB有影響。 Hypothesis 1: Supervisor UPB is positively related to employee UPB.
</aside>

* 檢視資料內容摘要、敘述統計值
. summ upb_manipulation dc_manipulation eUPB1 eUPB2 eUPB3 eUPB_tot
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
upb_manipu~n | 297 .4882155 .5007048 0 1
dc_manipul~n | 297 .5050505 .5008183 0 1
eUPB1 | 297 2.787879 1.908052 1 7
eUPB2 | 297 2.673401 1.914842 1 7
eUPB3 | 297 2.690236 2.009691 1 7
-------------+---------------------------------------------------------
eUPB_tot | 297 2.717172 1.871649 1 7
. tabulate upb_manipulation
* 高低兩組樣本數(49:51)
Manipulatio |
n of UPB | Freq. Percent Cum.
------------+-----------------------------------
Low UPB | 152 51.18 51.18
High UPB | 145 48.82 100.00
------------+-----------------------------------
Total | 297 100.00

* 依據 by (主管的UPB程度高低) 檢測對於 員工UPB 的影響大小
* 高低兩組,使用t檢定。(三組與三組以上,使用「變異數分析ANOVA」)
**. ttest eUPB_tot, by(upb_manipulation)**
**Two-sample t test with** equal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. err. Std. dev. [95% conf. interval]
---------+--------------------------------------------------------------------
Low UPB | 152 2.208333 .124067 1.529601 1.963202 2.453465
High UPB | 145 3.250575 .1699401 2.04635 2.914675 3.586474
---------+--------------------------------------------------------------------
Combined | 297 2.717172 .1086041 1.871649 2.503438 2.930906
---------+--------------------------------------------------------------------
diff | -1.042241 .2090057 -1.453573 -.6309102
------------------------------------------------------------------------------
diff = mean(Low UPB) - mean(High UPB) **t = -4.9867**
H0: diff = 0 **Degrees of freedom = 295**
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 1.0000
結果顯示: