I had a dream tonight

I had a dream tonight. I do the final revision of a paper following many months of work and submit it to an internet server. Only 30 minutes later the first science journal agent contacts me offering immediate publication. More and more offers arrive and I finally decide to hand it over to nice publishing company that will pay so much money to continue my research.

I woke up and Continue reading I had a dream tonight

Calendar sharing – 2 way

In a previous post we have create calendar snippets in ics format. PHPicalendar is the ultimate solution to stitch these calendar snippets together to a workgroup view.
I am using the built-in RSS feed to be noticed about any forthcoming events that are not sitting in my own calendar.
There is only one drawback: phpicalendar doesn’t offer any possibility to import back any new meeting into Sunbird or Outlook. By using the following patch of events.php it may, however, send you back an .ics file (that can opens Sunbird automatically if configured correctly) by just clicking on any new event.

events.php

 1:
 2:
 3:
 4:
 5:
 6:
 7:
 8:
 9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
58:
switch ($event['status']){
    case 'CONFIRMED':
        $event['status'] =    $lang['l_status_confirmed'] ; 
        break;
    case 'CANCELLED':
        $event['status'] =    $lang['l_status_cancelled'] ; 
        break;
    case 'TENTATIVE':
        $event['status'] =    $lang['l_status_tentative'] ; 
        break;
}
--------------------------insert start--------------------------
$ics ='BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
METHOD:PUBLISH
BEGIN:VEVENT
TRANSP:TRANSPARENT
CATEGORIES:WJST
DTSTART:'. date("Ymd", $event['start_unixtime']) .'T' . date("His", $event['start_unixtime']) . 'Z
LOCATION:' . stripslashes($event['location']) .'
DTEND:'. date("Ymd", $event['end_unixtime']) .'T' . date("His", $event['end_unixtime']) . 'Z
SUMMARY:' . $event['event_text'] . '
UID:462CB5E2-7A1D-11DB-A244-000393AE2CEE-'. rand(1000000000000,9999999999999) . '
SEQUENCE:3
DTSTAMP:20070808T000000Z
END:VEVENT
END:VCALENDAR';
$fp=fopen("tmp.ics","w");
fputs($fp,$ics);
fclose($fp);
--------------------------insert end --------------------------
$page = new Page(BASE.'templates/'.$template.'/event.tpl');

$page->replace_tags(array(
    'charset'        => $charset,
    'cal'             => $event['calname'],
--------------------------patch ------------------------------
    'event_text'         => '<a href=tmp.ics>'. $event['event_text'] .'</a>',
----------------------------------patch ----------------------
    'event_times'         => $event_times,
    'description'         => $event['description'],
    'organizer'         => $organizer,
    'attendee'         => $attendee,
    'status'         => $event['status'],
    'location'         => stripslashes($event['location'])    ,
    'cal_title_full'    => $event['calname'].' '.$lang['l_calendar'],
    'template'        => $template,
    'l_organizer'        => $lang['l_organizer'],
    'l_attendee'        => $lang['l_attendee'],
    'l_status'        => $lang['l_status'],
    'l_location'        => $lang['l_location'] 
    ));

$page->output();

?>

If your calendar ics are really up to date, you may want to change $actual_calname in ical_parser.php to
$actual_calname = getCalendarName($filename) . ‘ (-‘ . round((time() – filemtime($filename) )/100000) . ‘ days old)’;

An alternative to Pearson R^2

There is a nice online example of four datasets that show exactly the same variable mean AND Pearson R^2 although they look quite different!

I show here an alternative R solution for the correlation ratio eta that may help if you are dealing with such data.

anscombe.R

 1:
 2:
 3:
 4:
 5:
 6:
 7:
 8:
 9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
46:
# http://en.wikipedia.org/wiki/Anscombe%27s_quartet

ansc <- as.array(matrix(c(
10.0,8.04,10.0,9.14,10.0,7.46,8.0,6.58,
8.0,6.95,8.0,8.14,8.0,6.77,8.0,5.76,
13.0,7.58,13.0,8.74,13.0,12.74,8.0,7.71,
9.0,8.81,9.0,8.77,9.0,7.11,8.0,8.84,
11.0,8.33,11.0,9.26,11.0,7.81,8.0,8.47,
14.0,9.96,14.0,8.10,14.0,8.84,8.0,7.04,
6.0,7.24,6.0,6.13,6.0,6.08,8.0,5.25,
4.0,4.26,4.0,3.10,4.0,5.39,19.0,12.50,
12.0,10.84,12.0,9.13,12.0,8.15,8.0,5.56,
7.0,4.82,7.0,7.26,7.0,6.42,8.0,7.91,
5.0,5.68,5.0,4.74,5.0,5.73,8.0,6.89
),nrow=11,ncol=8,byrow=TRUE))
colnames(ansc) <- c("x1","y1","x2","y2","x3","y3","x4","y4")

op  <- par(mfrow=c(2,2),las=2,ps=10)
plot(ansc[,1],ansc[,2])
plot(ansc[,3],ansc[,4])
plot(ansc[,5],ansc[,6])
plot(ansc[,7],ansc[,8])
par(op)

cor(ansc[,1],ansc[,2])
cor(ansc[,3],ansc[,4])
cor(ansc[,5],ansc[,6])
cor(ansc[,7],ansc[,8])

# eta2
# http://www.opensubscriber.com/message/r-help@stat.math.ethz.ch/7023887.html
# http://www2.chass.ncsu.edu/garson/pa765/eta.htm

eta2<-function(col1,col2) {
    col2 <- cut(col2,quantile(col2,seq(0,1,by=.25),na.rm=TRUE),include.lowest=TRUE,na.rm=TRUE)
    col.aov <- aov(col1 ~ col2)
    ss <- anova(col.aov)$"Sum Sq"  
    eta2 = ( ss[1]/sum(ss) )^2
    return(eta2)
}

eta2(ansc[,1],ansc[,2])
eta2(ansc[,3],ansc[,4])
eta2(ansc[,5],ansc[,6])
eta2(ansc[,7],ansc[,8])

Sweave – seamless statistics and document automation

The R Munich user group likes Sweave. Here are 3 screenshots how to create a seamless R + Open Office integration (which works also for Word documents if you have installed the ODF converter plugin). First create your document

sweave.R

 1:
 2:
 3:
 4:
 5:
 6:
 7:
 8:
 9:
10:
12:
# the document d:/roffice.odt needs some code like (please remove leading #)
# not interpreted text
# <<MyOutput,echo=TRUE>>=                 
# print(iris[1:10,])
# @
# not interpreted text

install.packages("odfWeave", dependencies=TRUE)  
library(utils)
library(odfWeave)
odfWeave("d:/roffice.odt","d:/roffice_.odt")

the document

sweave01.png

save it, open R and execute

sweave02.png

Your document will then look like

sweave03.png

Sex and drugs and rock and roll

We should have listened to our parents — but so far I did not see a major adverse potential of cannabis. This might have been wrong having heard last year the terrible story of a friend who lost her son by drug induced psychosis. Last week I even learned that this may be Continue reading Sex and drugs and rock and roll

An editor is one who separates wheat from chaff and then prints the chaff I

Here is a little tale that could have happened every day. An author sends a major paper to a major journal. The major journal has a major editor that asks other major reviewers before writing a major email. Continue reading An editor is one who separates wheat from chaff and then prints the chaff I

Human parthogenesis

Stem cell researchers now believe that the human ES cell line SCNT-hES-1 (you may renember Hwang who claimed having first cloned a human by somatic cell nuclear transfer) is derived by parthogenesis – the result of a dividing human oocyte.
They test the origin of the Hwang cells by genome-wide SNP analysis as the initial DNA fingerprint was doubtful Continue reading Human parthogenesis

Allergy transplantation

A new paper in Transplantation takes up an old question – can you passively transfer asthma or allergy? It seems so – the current study reports in 5 of 42 patients elevated IgE plus allergy symptoms. This is in line with earlier reports. Sorry to say — you can get allergy also by bone marrow transplantation.

 

Addendum 10/6/08
Blood

A total of 16 nonallergic recipients with allergic donors were reported to develop allergic disease posttransplant, however, conclusive information was available for only 5 cases. Allergic disease was reported to abate in 3 allergic recipients with nonallergic donors, however, conclusive information was available for only 2 cases. Problems in interpreting the reports include incomplete data on allergic disease in the donor or recipient pretransplant, not knowing the denominator, and the lack of controls. In summary, review of the literature generates the hypothesis that allergic disease is transferable

 

Addendum 14/7/22
Ann All Asthma Immunol

Any new paper? A video cast how to stay informed

Following a frequent request, here is a short video how to create your own Pubmed news feed. You simply need the Sage plugin for Firefox; then goto to Pubmed, create your personal RSS feed and import this URL into the bookmark category that Sage is looking for. Here is the show: Continue reading Any new paper? A video cast how to stay informed

Detecting repoxygen infection

Doping rules are sometimes hard to understand. Sleeping in a low pressure chamber and training at high altitudes is allowed but taking epo is not – although net effects may be the same.

This might be a reason why some athletes are now trying to mimick more closely biology. Repoxygen is a viral vector known for some time that includes the human epo gene under control of a hypoxia control element. Clearly this drug has the potential to be used for doping (“Outlaw DNA“). Continue reading Detecting repoxygen infection