# Compute Cohen’s d for t-test

• 父亲量表中的情感温暖与理解、拒绝否认、惩罚严厉、过分干涉均存在显著差异，其中在情感温暖与理解和过分干涉两个维度上城乡差异达到了极显著的水平(t = 4. 89, p < . 001; t = 2. 81, p < . 01)。
• 母亲量表的拒绝否认、过分干涉过度保护和惩罚严厉等三个维度上存在显著的差异，其中在拒绝否认维度上存在非常显著的差异(t = 2. 57, < . 01)，表现为城市被试在上述维度上的得分显著或极显著地高于农村被试。

Below we estimate Cohen's d as effect size as well as its confidence Intervals,

For t-tests, the effect size is assessed as

$d=\frac{\left | \mu_1-\mu_2 \right |}{\sigma}$

$\sigma=\sqrt{\frac{(n_1-1)S_1^2+(n_2-1)S_2^2}{n_1+n_2-2}}$

Hence, with data above, we analyse the factor “父亲情感温暖与理解” as example.

According to Cohen, J. (1977), this is a small effect. Given the large sample size (474, 421), significant difference between urban's and rural's father parenting style shall be reconsidered. Moreover, confidence intervals on Cohen's d shall be computed.

Reference:
Cohen, J. (1977). Statistical power analysis for behavioral sciences (revised ed.). New York: Academic Press.

# 练习-加上箱型图的散点图

i. 用函数lowess( )作出拟合线
ii. 在图的两边加上更细小的刻度
iii. 在图的两边加上箱型图