## Type III ANOVA in R

Type III ANOVA SS for factor A within interaction of factor B is defined as $SS_{A:B+A+B}-SS_{A:B+B}$, wherein A:B  is the pure interaction effect orthogonal to main effects of A, B, and intercept. There are some details in R to get pure interaction dummy IV(s).

Data is from SAS example PROC GLM, Example 30.3: Unbalanced ANOVA for Two-Way Design with Interaction

## Unexpectedly, the theoretically best reject-region of T-test is bounded.

$f_{t}\left(x;\mu,df\right)\equiv C\left(df\right)\left(1+\frac{\left(x-\mu\right)^{2}}{df}\right)^{-\frac{df+1}{2}}$ $\lambda\left(x;\mu_{0},\mu_{1},df\right)\equiv\frac{f_{t}\left(x;\mu_{1},df\right)}{f_{t}\left(x;\mu_{0},df\right)}=\left(\frac{v+\left(x-\mu_{1}\right)^{2}}{v+\left(x-\mu_{0}\right)^{2}}\right)^{-\frac{df+1}{2}}{\longrightarrow\atop x\rightarrow\infty}1$

For NHST $H_{0}:T\sim t_{df}$ vs $H_{1}:T-1\sim t_{df}$, theoretically, $p\left(t\right)=\int_{\left\{ x:\lambda\left(x\right)\ge\lambda\left(t\right)\right\} }f_{t}\left(x,\mu_{0},df\right)dx$ is s.t. $\lim_{t\rightarrow\infty}p\left(t\right)=\frac{1}{2}$ , rather than zero. Nevertheless, pratically a large t, rejecting both $H_{0}$ and $H_{1}$, should not be counted as any evidence to retain or reject $H_{0}$.

To verify the shape of $\lambda\left(x\right)$ --

## Confidence Region and Not-reject Region

Either Confidence Interval (CI) or Null Hypothesis Significance Test (NHST) has the same business, to advise whether some sample $X\equiv\left(X_{1},X_{2},\dots,X_{n}\right)$ is or is not disliked by some hypothesized parameter $\vartheta$.

NHST.com manages a database. For each Miss $\vartheta$, NHST spies out all she dislikes. Mr X logs in NHST.com and inputs a girl name and his credit card number, to bet his luck whispering-- Does she dislike me?

CI.com manages a database too. For each Mr X, CI only needs his credit card with his name X on it, then serves him a full list of available girls.

NHST.com has been historically monopolizing the market. Nevertheless, somebody prefer visiting CI.com and find that the two may share database in most cases.

Not-reject Region of $\vartheta$ is defined as $A\left(\vartheta\right)=\left\{ x:\vartheta\; doesn't\;dislike\;x\right\}$.

Confidence Region of x is defined as $S\left(x\right)\equiv\left\{ \vartheta:\vartheta\; doesn't\;dislike\;x\right\}$.

$\theta\in S\left(X\right)\Leftrightarrow \theta\,does\,not\,dislike\,X$ $\Leftrightarrow\,X\in\,A\left(\theta\right)$

So, $Pr_{\vartheta}\left(\vartheta\in S\left(X\right)\right)\ge1-\alpha,\forall\vartheta\Longleftrightarrow Pr_{\vartheta}\left(X\notin A\left(\vartheta\right)\right)\le\alpha,\forall\vartheta$

## Automatize LISREL jobs

LISREL routine can run in DOS or in command line mode of windows (windows-key + R -> CMD) . The command line is just like --

D:\My Documents>"C:\Program Files\lisrel87\lisrel87.exe" "C:\Program Files\lisrel87\LS8EX\EX61.LS8" D:\myOutput.out

1. You only need edit and input the bold part.
2. Quotation marks are used wherever the paths or filenames include blanks.
3. The 2nd argument is the output file. You can still specify more output options in your .ls8 file.
4. A .bat file can automatize batches of such lisrel jobs.

## Developing normal pdf from symmetry & independence

When I was in the 3rd grade of my middle school, I enjoyed my town bookstore as a standing library. There a series of six math-story books by Zhang Yuan-Nan impressed me a lot. I cited a case from one in my PPT when I taught the normal distribution -- the normal pdf can be derived from simple symmetry & independence conditions.

Today I can even google out an illegal pdf of its new edition to verify the case (2005, pp. 89). Actually I have bought the new edition series (now 3 books) and lent them to students. Those conditions are as instinctive as--

1. For white noise errors on 2-D, the independence means pdf at $(x,y)$ is the product of 1-D pdf, that is, $\phi\left(x\right)\phi\left(y\right)$.

2. The symmetry means pdf at $(x,y)$ is just a function of $x^{2}+y^{2}$, nothing to do with direction. That is, $\phi\left(x\right)\phi\left(y\right)=f\left(x^{2}+y^{2}\right)$.

So, $f\left(x^{2}\right)f\left(y^{2}\right)=f\left(x^{2}+0\right)f\left(0+y^{2}\right)=\phi^{2}\left(0\right)f\left(x^{2}+y^{2}\right)$.

For middle school students, the book stated a gap here to arrive at the final result $f\left(x^{2}\right)=ke^{bx^{2}}$, which is $\phi\left(x\right)=\frac{1}{\phi\left(0\right)}f\left(x^{2}+0\right)=\frac{k}{\phi\left(0\right)}e^{bx^{2}}$.

I think non-math graduate students with interests can close the gap by themselves with following small hints.

Denote $\alpha=x^{2},\beta=y^{2}$.
We have
$\log f\left(\alpha\right)+\log f\left(\beta\right)=\log\phi^{2}\left(0\right)+\log f\left(\alpha+\beta\right)$,
or
$\;\;\left[\log f\left(\alpha\right)-\log\phi^{2}\left(0\right)\right]+\left[\log f\left(\beta\right)-\log\phi^{2}\left(0\right)\right]$  $=\left(\log f\left(\alpha+\beta\right)-\log\phi^{2}\left(0\right)\right)$.
Denote $g\left(\alpha\right)=\log f\left(\alpha\right)-\log\phi^{2}\left(0\right)$.
That is, $g\left(\alpha\right)+g\left(\beta\right)=g\left(\alpha+\beta\right)$.

Now to prove $g\left(\frac{m}{n}\right)=\frac{m}{n}g\left(1\right),\forall m,n\in\mathbb{N}$. With continuousness, it gets $g\left(\alpha\right)=\alpha g\left(1\right),\forall\alpha\in\mathbb{R}$.

## [二度更新并推荐]愉快地发现SciTE和LyX在WinXP下都支持中文

SciTE的设置是Options->Open Global Options File，编辑SciTEGlobal.properties，找到如下段落

# Unicode
#code.page=65001
code.page=0
#character.set=204
# Required for Unicode to work on GTK+:
#LC_CTYPE=en_US.UTF-8
#output.code.page=65001

# Unicode
code.page=65001
#code.page=0
character.set=204
# Required for Unicode to work on GTK+:
LC_CTYPE=en_US.UTF-8
output.code.page=65001

[update] 除了utf-8, SciTE 还支持国内更常用的GBK码，设置如下：

code.page=936
output.code.page=936
character.set=134

LyX(版本>=1.5.1)在winXP已经可以在.lyx文件正文和公式框中录入中文。麻烦的是输出中文的pdf。[UPDATED update]LyX的最新版本(1.6.2)捆绑MikTeX的安装包已经对中文(unicode)支持得很好了。感谢楼下joomlagate先生email给我的情报：http://cohomo.blogbus.com/logs/31361739.html 的后半篇介绍了通过XeTeX输出pdf的简单设置。我今天试了一下，效果非常理想。

[update]公式框中的中文只需要再ctrl-M一次即可。例如，\frac{\mbox{分子}}{\mbox{分母}}可以输出，而\frac{分子}{分母}不行。

LyX主页 http://lyx.org/

LyX中设置XeTeX中文支持的介绍： http://cohomo.blogbus.com/logs/31361739.html

## My first wp plugin work: LaTeX_Math_cgi 1.0

It is actually used as a mimeTeX plugin rather than just a $L^{A}T_{E}X$ plugin. My contribution is technically trivial. But, you must need it if you change from a light theme to a cool black one while find the default mimeTeX images are black in front and transparent in background. This plugin provides mimeTeX's \reverse and \opaque options to tune your math forms to your wp theme without editing them one by one.