Welcome

Featured

This is Jonas Ranstam’s personal website with CV, publications list, presentations from recent lectures and computer scripts for statistical calculation. It also features a blog with comments on statistical issues and suggestions on how to solve some software and hardware problems. In addition, the website provides practical facilities for statistical computation, for making appointments, and for transferring confidential files securely.

Printing to any printer from an iPad or iPhone with Ubuntu 12.04

I have an iPad, but no AirPrint enabled printer, which was quite annoying until I found this description on how to print to any printer from an iPad or iPhone. It works by running a daemon creating avahi profiles via dbus for the systems printers, and by monitoring CUPS for changes, updating avahi accordingly.

In short, run these commands in a terminal window:

sudo add-apt-repository ppa:hughescih/ppa
sudo apt-get update
sudo apt-get install airprint-daemon

Then go to the printer settings (http://localhost:631). Check ‘Publish shared printers…’ and ‘Allow printing from Internet’.

The software has been tested and is known working for Ubuntu 9.04 and 10.10. It works fine for me with Ubuntu 12.04.

Statistical adjusting for confounding factors

The greatest difference between experimental and observational medical research is that randomization and blocking, which can be used in experiments but not in observational studies, effectively removes the potentials for confounding bias from both known and unknown confounding factors. Random baseline imbalance can of course still occur with randomization, but not systematic. If the random imbalance of some risk factor is a problem, the solution is to stratify the randomization on this factor.

In observational research confounding bias has to be accounted for in the statistical analysis, and this is much more problematic, can only be achieved with known and measured risk factors. The fundamental weakness of research is that much is unknown. This is actually the reason research takes place. Few health related outcomes can, however, be predicted with precision. The proportion explained variation is often small, perhaps just one or two percents as with the revision risk of a knee- or hip prosthesis, or ten to fifteen percents as with patient reported outcome measures. The potential for residual confounding is thus substantial.

A further problem is to specify the causal relationships in a statistical model. Different forms of automatic selection (stepwise regression) should be avoided. Including wrong variables or too many or too few may cause bias instead of reducing it.

Principles for finding the model minimizing bias has been developed (1) and a computer program, DAGitty, implemented. With this program, which is available here as well as here, the best statistical model (i.e. which minimizes bias) can be found.

Reference

1. Shrier I, Platt RW. Reducing bias through directed acyclic graphs. BMC Medical Research Methodology. 2008, 8:70.

Confidence intervals, prediction intervals and tolerance intervals

Confidence intervals appear frequently in medical articles but are not always used correctly. A confidence interval reflects the sampling uncertainty of an estimated parameter. Consider a discussion about the precision of a new measurement instrument.

The mean measurement error of a the instrument can be described with a confidence interval. But this interval indicates the uncertainty in the estimated mean value. It does not give any information on the range of likely measurement errors, which is important to know when using the instrument.

A 95% prediction interval, enclosing 95% of observed individual measurement errors, could be used to describe the precision of the instrument. The chance is 95% that the next measurement error will be included in the interval.

In contrast to the confidence interval, the prediction interval does not depend on the number of observations. A greater sample size, means lower uncertainty regarding the mean value, but not regarding individual variation. A prediction interval is therefore wider than the confidence interval.

The prediction interval may, however, not be very useful in practice. It works in the long run, when the entire procedure is repeated many times. The predicted measurement error will be included in 95% of all the constructed 95% prediction intervals, but 95% is an average; the uncertainty of a individual prediction is unknown.

To be 95% sure that a specific interval includes 95% of the measurement errors we need to calculate a tolerance interval. This is based on two different percentages: one reflecting uncertainty, the other one precision.

More detailed description of these different intervals and of how they are calculated can be found in statistical literature (1,2).

Reference

1. Hahn GJ, Meeker WQ. Statistical Intervals: A Guide for Practitioners. 1991, New York, Wiley.

2. Vardeman SB. What About the Other Intervals? Am Stat 1992;46:193-197.

How to disable the touchpad in Ubuntu

The touchpad is in some cases extremely annoying, and just inactivating the touchpad while typing does not seem sufficient, at least not for me. To inactivate the touchpad altogether I used these commands.

sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install touchpad-indicator

Then add the command “touchpad-indicator” to Startup Applications.

Mendeley and Ubuntu 11.10

Mendeley is a free reference manager and desktop/web program for managing research papers. When I recently installed Mendeley on my laptop I could not connect to the Internet. The program got stuck just after start, requesting information about a proxy server.

The solution was to install the libqt4-webkit and libqt4-svg packages. This is the command to use at the commandline:

sudo apt-get install libqt4-webkit libqt4-svg