bioinformatics scholarship in Belgium

I don’t know if you’re still interested in a PhD in Bioinformatics and computational biology at the University of Leuven, Belgium. The position you applied for is already filled, but there is currently a special call for scholarships for students coming from China, from the China Scholarship Council (CSC) http://www.kuleuven.be/csc/index.html. Perhaps it could be interesting to apply for a PhD fellowship together. The application deadline is 15th Februari 2010 , if selected PhD starts September 2010. I have submitted one project one “gene regulation bioinformatics”, that can be found under the research themes, but you can also propose your own research project. Information about selection, application, and and requirements can be found on the website.

Let me know if you’re interested,

突然收到这样一封信,我回复他说,很遗憾地告诉你,我把你拒了。
没想到,他回了这么一条:

Thanks for your reply. Feel free to forward the link to Chinese bioinformatics students who could be interested, and who you know are good students.

举手之劳嘛,我就到处帮他宣传一下,发现还没在自己的一亩三分田里share过这个消息。遂贴过来。

还是挺不错的,这个奖学金只给中国的学生,所以中奖概率应该会蛮高的。看他给我的回复,就可以看出来,申请的人太少了。可能知道这个消息的人本身也不多吧。

我问过在比国留学的朋友了,这学校在比国,是个牛校。

用数字当变量名

可以用"_"开头做变量名,还可以用数字当变量名.
几乎所有的语言都不允许,R也不例外,当是如果用引号就可以违反这条规则.

> "10" = 20
> "_a" = 10
> ls()
[1] "_a" "10"

问题就出现了,如何取得这个变量的值呢?

> _a
错误: 意外的输入在"_"里
> "_a"
[1] "_a"
> 10
[1] 10
> "10"
[1] "10"

不加引号,不行,加了还是不行.

解决的办法就是使用get函数.get需要的参数是变量名,要求必须是字符串.

> get("_a")
[1] 10
> get("10")
[1] 20
> get(as.character(get("_a")))
[1] 20

very tricky…

Xmarks同步到自己的地盘

Xmarks是一个同步化书签的firefox插件。

我倒不是经常在不同地方用不同的电脑,但是我通常是装linux和windows双系统的,我希望两个系统用同一个书签。在一个系统里修改书签,在另一个系统里可以自动更新成一样的。

Xmarks现在被墙了,有些不爽。虽然我翻墙了,但Xmarks依然无法更新。

好在Xmarks可以使用自己的服务器,试了一下,还真行。

我在这个博客的ftp里建了个bookmarks的目录,用于存放Xmarks书签。

修改Xmarks的账户信息,用户密码改用ftp的,而不是原来Xmarks里注册的。

选择 “使用自己的服务器” 有两个url需要填。分别用于存放bookmark和password。password是放PIN的。

地址 ftp://ftp.azpala.com/bookmarks/xmarks.json
Password URL ftp://ftp.azpala.com/bookmarks/passwords.json

GFW威武!

方差检验

書接上一回,兩样本的t检验,有一種计算方法是假设方差一样,这个R提供了var.test函数检验这个假设是否成立。这个函数对两组数据的方差比值使用F检验,调用和t.test差不多。

> var.test(expend~stature)

	F test to compare two variances

data:  expend by stature
F = 0.7844, num df = 12, denom df = 8, p-value = 0.6797
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.1867876 2.7547991
sample estimates:
ratio of variances
          0.784446

这个结果,我们可以认为两组数据的方差是一样的。

var.test是基于两组数据是independent的,如果是成对数据的话,就不能使用这个来检验。

stats包里有好几種检验方法用于检验方差是否相同。

两样本的t检验

看两个样本的均值是不是一样,H0\mu_1 = \mu_2,这个和单样本的t检验基本上是没差别的。

计算统计量t = \frac{\overline{x}_2 - \overline{x}_1}{SEDM}
其中SEDM:standard error of difference of means代表均值差异的标准误。

SEDM有两个计算方法,取决于数据。
如果两个样本的方差一致,可以对数据进行混合。得到一个pooled s,当然样本量不一样,需要进行加权。这个得到的t值自由度是n1+n2-2。
pooled s的计算是:
S_{X_1X_2} = \sqrt{\frac{(n_1-1)S_{X_1}^2+(n_2-1)S_{X_2}^2}{n_1+n_2-2}}
相应的t值是:
    t = \frac{\overline{X}_1 - \overline{X}_2}{S_{X_1X_2} \cdot \sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}

如果两个样本的方差相差较大,实际上算出来的t值并不符合t分布,不过很接近,而且自由度由两样本的方差及大小所决定,通常不是整数。
这种情况下SEDM为:
  SEDM = \sqrt{{s_1^2 \over {n}_1} + {s_2^2 \over {n}_2}}
相应的t值为:
t = \frac{\overline{X}_1 - \overline{X}_2}{\sqrt{{s_1^2 \over n_1} + {s_2^2 \over n_2}}}
这个方法也叫Welch’s t test, 这个方法实际上更加robust。

> t.test(expend~stature)

        Welch Two Sample t-test

data:  expend by stature
t = -3.8555, df = 15.919, p-value = 0.001411
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -3.459167 -1.004081
sample estimates:
 mean in group lean mean in group obese
           8.066154           10.297778 

> t.test(expend~stature, var.equal=T)

        Two Sample t-test

data:  expend by stature
t = -3.9456, df = 20, p-value = 0.000799
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -3.411451 -1.051796
sample estimates:
 mean in group lean mean in group obese
           8.066154           10.297778

事实上两种方法给出的结果很相似,除非两个样本的大小和方差都很不一样。

—————
如果两个样本是成对的,必须使用成对的t检验,如果不使用成对t检验,t值会变小,p值会变大,准确性差了很多。

> t.test(pre, post, paired=T)

	Paired t-test

data:  pre and post
t = 11.9414, df = 10, p-value = 3.059e-07
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 1074.072 1566.838

成对的t检验公式如下:
t = \frac{\overline{X}_D - \mu_0}{{s_D}/\sqrt{N}}

从公式上可以看出,这个就是单样本t检验的一个翻本,成对的数据求差值,然后这组差值数据进行了单样本的t检验。

比如上面的例子,t值的计算如下:

> D <- pre-post
> mean(D)/(sd(D)/sqrt(length(D)))
[1] 11.94139
Pages: Prev 1 2 3 4 5 6 7 8 ...24 25 26 Next