Skip to content

{ Monthly Archives } October 2007

R: Simulating multiple normal distribution with any given corr matrix

For example , we have a corr matrix for five standardized factors (Hau, Chinese Textbook, pp. 49-50).
m_corr=c(1, .42, .41, .55, .42);
m_corr=cbind(m_corr, c(.42, 1,.48, .47, .46));
m_corr=cbind(m_corr, c(.41, .48,1, .48, .44));
m_corr=cbind(m_corr, c(.55, .47,.48, 1, .50));
m_corr=cbind(m_corr, c(.42, .46,.44, .50, 1));
m_corr;
## show the original corr matrix
dp=svd(m_corr);
plot(dp$d,type="o"); ## show the scree plot if there is a PC analysis
diag(dp$d); ## [...]

Tagged , ,

The tail(s) of p value

For any given vs , the p value of any given point x is , Where
-- See R. Weber's Statistics Note (Chap 6.2 & 7.1)
I made some wrong comment on the pdf Null Ritual (Gigerenzer, Krauss, & Vitouch, 2004) Where three types of significance level (rather than p value) were discussed. I had [...]

Tagged ,

相关系数的几何:对截距投影的残差向量之间交角余弦

一直马虎地以为两个列向量的内积就是它们所代表变量的相关系数,结果今天在学生面前出了一回丑,企图让一列常数和另一个列向量的相关系数接近1。大家都知道,一列常数和任何一个列向量的相关系数必定为零。
我的错误在于忘记了协方差表达式中,列向量作内积之前有一步中心化:减去全列的均值。被减去的实际上是一个向量,等于全列均值乘以向量,也就是在截距向量、也就是“对角线”轴方向上的投影。减去这个投影,是没有任何解释变量、只有截距项时的回归残差,这个残差向量和截距方向垂直,所以落在垂直于“对角线”截距向量(日晷指针)的线性子空间里(日晷盘)。协方差实际上是这样的两个残差向量内积,而相关系数就是两残差向量之间的夹角Cosine值。

Tagged ,

The Popperian falsibility behind Regression Discontinuity Design (RDD)

Figure linked From http://www.socialresearchmethods.net/kb/statrd.php (Trochim, W., 2006, Figure 2). The red line is the fallacious treatment effect.
Causal analysis entails counter-factualist comparison between the treatment and the control conditions (Mark, 2003; Maris, 1998). To define a causal effect, two respective imaginary latent groups are introduced. The comparison is between identical subjects in the actual treatment [...]

Tagged