Skip to main content


COVID19 and the Politik surrounding it

Danish authorities ( document the development in cases and deaths, both in the EU/EØS and on a global scale. In the previous weeks, I have seen a risk of death around 4 percent.

Update 27/3-2020: In Italy, we observe a risk of death greater than the risk of death from SARS. I expect a wave of viral spread in Europe from Italy and Spain through France and Germany and exponential growth in number of cases for weeks to come. The novel virus will take its toll the next years in symbiosis with influenza. Hundreds of thousands will die changing the hygiene culture and demanding reform of health services in the Western world. The development in Japan is now worse than a month ago. Japan remains the most successful nation relative to its population size.

Links to monitoring tools and sites:…
Recent posts

Simulation of hemophilia bleeds

A SAS simulation study describing bleeds in hemophilia type A and B patients. Based on the "proof-of-concept study" Randomized, prospective clinical trial of recombinant factor VIIa for secondary prophylaxis in hemophilia patients with inhibitors by Konkle et. al. published in Journal of Thrombosis and Haemostasis, 5: 1904-1913 in 2007.

The epidemiology and design of the study are not in accordance with CONSORT and SPIRIT as of December 2019. We observe 22 included patients (11 in each group) allocated from 20 sites in 11 countries. Neither the randomization nor the analysis is stratified by center, and it is possible to question the logistics of the experiment. People have asked if a condition on the number of bleeds (above 4 for each month in the pre-prophylaxis period) introduces bias: The study is a comparison of the effect of dose-difference not the effect of the drug, although the mean of bleeds in the first period is obviously higher than in the second period. Suspici…

Indicators from numeric factor variables

The macro call below will generate indicators for all factor levels of xfaktor from the data set regdata represented by at least 5 observations. I have developed the macroes to avoid class variables in SAS regression analyses.


/* Macro to generate dummy variables. */
  %DO I = 1 %TO &N;
  %IF &&M&I NE 0 %THEN %PUT &factor&I;
  %IF &&M&I = 0 %THEN %GOTO OUT;
    IF &factor = &&M&I THEN &factor&I = 1;
    ELSE &factor&I = 0;
  %OUT: %END;

%macro indicator(factor,dataset,size);
data tbl_data_;
set &dataset(keep=&factor);
proc sort data=tbl_data_; by &factor; run;
data tbl_;
set tbl_data_;
by &factor;
retain sz;
if first.&factor then sz=1;
else sz=sz+1;
if last.&factor then output;
  BY &factor;
/* Assign the largest value of CON to the macro variable N. */

Graphics in SAS SGPLOT illustrating ANOVA analysis results.

Output and graphics from statistical programming packages are often time-consuming to read and interpret. In peer-reviewed publications you usually provide both a written assessment, tables and graphics illustrating data and analysis results. ANOVA analysis is still a very common analysis technique and it is possible to beautify the output from analysis using PROC SGPLOT

ods graphics;
proc format lib=work;
value timevar
12='0-12 hrs'
18='12-18 hrs'
24='18-24 hrs'
32='Cumulated 0-24 hrs'
proc sql;
  create table estimates
    (  Treatment char(12) label='Treatment Group'
     , Time      num      label='Visit number'
     , Time2     num      label='Visit number'
     , TimeVar   char(18) label='Visit number'
     , Mark      char(8)  label='p values'
     , Est       num      label='Est'
     , LCL       num      label='LCL'
     , UCL       num      label='UCL'
insert into …

T tests in censored normal distribution

T-tests assume normal distributed random variates. We experience designs in which data take on a particular value and are otherwise normal distributed on a half axis. It might be the case in experiments in which a regimen is only applied due to symptoms or the participant's request. In such case a censored normal distribution assumption will increase the strength of the experiment, i.e. statistical power will be increased and assumptions of an underlying normal distribution will be easier to justify.
The suggested test is based on the chi-square likelihood ratio test. The example is two independent groups of identical independently distributed samples and the null hypothesis is identical distributions. The density function splits into single probability, given as the integral of a normal density from negative infinity to the lower bound and the density of the normal distribution for values larger than the lower bound.
The expression involves the distribution function for a Gaussia…

Free electrical energy from central heating and water supply

Anyone investigated central heating and water installations as a source for the generation of electricity? I have a 6-10 bar pressure on water coming from the public supply.
A drop of 4 bar equals potential energy from a 40m waterfall like Queen Mary Falls, Australia. A lot of wasted energy released in your toilet and other places.
How do we make use of all that energy? Central heating is delivered at high pressure and leaves at high pressure after a temperature drop between 30 and 50 degrees.
Can we use 1 bar, 2 bar or 3 bar to slow down the hot water and generate electrical energy and extract more heat before return? Let's calculate. If 100 cubic meter of heated water falls 40 meter, how much energy could we theoretically get, although practically unreasonable?
Approximately 40*10*(100*1000)J or circa 40 kWh.
40 kWh costs circa DKK 90 in Denmark, or USD 13
... or the price of a LED light bulb.

In the US typical household power consumption is about 11,700 kWh each y…