Saturday, March 10, 2012

Visiting Kenya

26. February 2012, Sunday, Nairobi, Kenya

After a day of travels I am arriving to the Nairobi International Airport for my second visit of Africa, first in Kenya and as I saw on the map, first on the southern hemisphere.  I came for meetings and future-project discussions with people from the International Livestock Research Institute (ILRI). Similarly as in Ethiopia, also here I would like to note down my feelings and experiences. As in case of Ethiopia, take it as a random sample and do not make general conclusions out of it, this is what happened to me described from my viewpoint.
As I said I came for discussions, but the travel is actually bounded with the program of people coming from Swedish Agricultural University (SLU). The have already a project running in Kenya, and their goal is to visit the project sites, among others. They kindly agreed to take me along, which is a great opportunity for me to see the actual countryside of Africa. One of the SLU people is a “giant” of development research, so I hope to listen and learn as much as I can during the trip. My very first stay in Addis was mostly within the ILRI campus, so now I am going to see more diverse environments. Today we take as the arrival day with only some leisure program, the work begins tomorrow.
We arrived for a nice sunny day with daytime temperatures around 30. A pleasant day indeed, although I am quite tired after the long flight. We drive through the city on Narobi when coming to hotel and I must say that I like it more than Addis. It is much greener with more parks and nicer buildings. The signs of the British Empire are clear in the country with the driving on the left, cars with steering on the right. Our way was very fluent the whole time, but according to insiders this was due the Sunday morning drive with almost no cars. Otherwise traffic jams are quite common here as well, or so I heard. We will do quite a bit of car driving during the week, so I can tell more about this at a later stage.
 The hotel we are in is a nice one, on a good spot. Upon arrival everybody got a keycard except me. I got a normal key with an attached plastic holder with the most famous Barrack and a YES WE CAN on it. The receptionist said that it is the “best key”. Not sure what he meant, but it might be a reference to the picture. Other fun fact: When I came to the room and browsed through the tv channels, I found the opening scenes of “Out of Africa” with Meryl Streep and Robert Redford. Old, slow paced, a bit-too-long, but a reasonably good movie with most of the cast done in Kenya.


27. February 2012, Monday

Today was the first working day of the stay, spent mostly at the ILRI campus. Right at the breakfast I was asked if I brought malaria pills along. I guess this was a standard question, but I had to answer with a ‘’no”.  Then I realized that we are going to a region where there is more than a theoretical chance to get infected. It was not an issue in Addis, but in wet lowlands of Kenya it is possible indeed. Naturally I freaked out. Fortunately the Swedish “big boss” got a spare box of pills which he gave to me. As I understood you could get malaria also with the pills, but the outcome should be much less serious. I hope I can skip the experience anyway.
After arrival to ILRI we were discussing the details of the ongoing SLU sheep project already running in the country. I realized (again) that it is a huge undertaking to get information about the animals in a “developing” country. Traits and data which you expect to be there are collected, transferred and translated into digital form with a great effort. Additionally one has to think about keeping the good relationships with the farmers, hire trustworthy enumerators or deal with their eventual imprecisions.  One of the issues was that on a certain remote site the sole computer got a virus and was unusable for some time, stopping the data flow. The other issue was that one of the regions is inhabited by two tribes, and they were not accepting enumerators from the neighboring tribe. And there were lots of other issues that you would not think about in a “European” setting.  After the whole day meeting and the quick tour of the (huge!) BecA lab facilities we returned to the hotel.
Naturally we thought about dinner. The suggestion was to go outside. After a discussion of the dubious security of Nairobi after dark I felt quite uneasy., but finally we settled on a place nearby. After my dinner-burger and fries we went back to the hotel on foot. Almost immediately we got tailed by a woman offering something to sell. She appeared to be harmless except of the constant chatter, but I felt re-assured that walking outside is not the best choice.  Eventually the woman gave up, and we arrived to the hotel avoiding the many small claques on the pavement (btw. another good reason why to avoid unlit areas, especially after rains).

Other fun fact from today: After the malaria discussion at the breakfast I kept thinking about it. During the meeting before noon I was feeling very hot, and assumed to be the first signs of an illness from the mosquito from yesterday. This was until I realized that I am sitting in a light sweater in a room near the equator (about 25-30 C) and I am drinking the second big cup of coffee in 2 hours… Happens… Removing the sweater and stopping with the coffee made the trick, of course.  

28. February 2012, Tuesday

I just returned from the full day field trip, visiting sites of the sheep project. We started early in order to bypass the traffic jams and be at given times at given places. We went with 2 all-terrain vehicles, which turned to be out the only possible solution. Details later. The first part of the trip were on a newly built very good quality tarmac road. I have to mention that this road led to Mombasa, one of the major cities of Kenya. Despite of its importance there were no signs pointing out directions, at least at its newest parts. The driver knew of course where to go, but if I would be on my own I would have a 50% chance to take a wrong turn on each junktion. Crossing of major roads by pedestrians at any place is quite prevalent in Nairobi as well, similarly to Addis. But is you think the pedestrians are not the only ones causing dangerous situations. During a traffic jam I seen cars, matatus and even buses extending the road and using a proper pedestrian walkway! Just unimaginable back at home.

Also the overtaking on the Mombasa road is quite an experience. Imagine a truck going uphill with 20km/h. A second truck overtaking it, going 30km/h. A third truck overtaking the other two at the same time and just after it our jeep hoping to squeeze in… I can tell you, at some point I was rather not looking what is going on.
Finally, at one point we turned to a dirt side road, and from there on the things were getting bumpy. It rained again during the evening, so the road was full of mud, which would have caused great problems if we had any other type of car. Of course the signs were missing here as well, which is more understandable in the middle of the savannah. Although I would appreciate a “Next settlement 50 km” sign for the unaware travelers. The outcome is that you have to do your homework before trying to go somewhere around here on your own. You have landmark points though. To get to the farm of Moses, where we were heading, one has to turn right on a crossing with 3 trees. Not joking here… Literally there were 3 trees in a crossing. After that you have a bunch of unmarked crossings leading in all directions, where you just have to know where you are going. At some point I was not even sure if we are on road any more, as you could not see the car trails on the rocky ground. As I was told the layout of the roads keep changing all the time from various reasons, they might be completely erased by the combination of sand and wind and on the top of that they are completely unusable during the rainy season. If you are somewhat familiar with development issues you often hear the term “market access”. I can tell you, after today’s ride I realized the meaning and the importance behind the “access” part.

The farm of Moses consisted of a simple house and several fenced off areas where he keeps quite large flocks of sheep, goats and cattle. I knew that he was the bigger farmers, but seeing 100+ animals was interesting. The natural companion of such amounts of livestock are the flies, which were all over the place. First they bothered me quite a lot, especially when I was thinking about all the places they might have visited just minutes ago. But after some time I accepted them as such, occasionally hushing them away. We proceeded with the grading and the interview of the farmer, mainly focusing on questions such: Which are the best, average and worst animals per breed?, Why?, their advantages and disadvantages? Later on the team also proceeded with body measurements. From the works done by other guys at BOKU I was aware about certain difficulties, one might face douring the field work, but this was the first time I took part. Moses appeared to be a knowledgeable person who knew his flock very well. He is a bright example of a farmer keeping records, which is not that usual in many places even in “more developed” countries. Despite of this the answers he gave were like “I liked the dam of this animal.” “This one had two offspring in 2 years, one died.” “This one takes care of the lambs very well.” “This one has problems all the time and it is kept alive only via vaccinations.” Depending on the aim of the study these are valuable information, but it is far away from the databases I used to handle. It is very difficult to put statistics on his answers, but I think the statistics should not be the main driver of the study anyway. Animal breeding in these countries requires a very different mindset, even if the underlying goal of genetic gain is the same as everywhere else. One has to re-phrase the questions and ask what are the farmer’s needs? How can we help them with, given environment and the available resources? Tackling these questions one can give phrases such “poverty alleviation” and “food security” a real meaning.

29. February – 3.March 2012

The program of the stay continued with discussions of the results/experiences from the previous day and gearing up for the next field visit. This time it should be an area requiring about half a day travel time. I left my laptop and main suitcase in the hotel and started the two day trip with only a backpack, some food and a bottle of water.
The ride to the Amboseli area offered a snapshot of the life in Kenyan small cities and rural areas. At the beginning we took the Mombasa road again, but this time a longer part. At places where it was crossing with other roads it created its own small cities consisting from small shops selling food, car spare parts, mobile phones and all other things that people, in this case mainly truck drivers, might need. Hotels were there as well starting from the ones looking reasonably good (at least from the outside), but there where also some shacks from tin plates, apparently advertising free room capacities.
In the evening we arrived into a small place called Sultan Hamud which was very similar to other Kenyan small cities. Low profile buildings, quite clean but dusty roads. This had a mosque and several houses with satellite dishes on them in addition to the other “regular” ones. Sultan Hamud was the place where I saw the biggest contrast so far. From inside it was a beautiful hotel belonging to an Italian guy, outside the present reality of Kenya. In between a high fence with barbed wire.  It was an odd feeling walking inside the garden, looking at the hotel pool, knowing that just a few meters away there are people living in completely different conditions.
Inside of the hotel facilities...

...and the outside world.



The next day we went to visit another farm with Red Massai sheep. This area was quite different from the previous one, with traditional Massai huts loosely grouped together with a fairly large area holding the livestock in the middle. Most of the animals were sheep and goats with a few heads of cattle and a small donkey herd. I was told that the reason of such low number of cattle around in that most of the cows died during the serious draughts in the previous years. People started to re-stock just recently, which was visible from the apparent low age of cows. The draughts are also the reason why the people started to look at the milk production of sheep. The ILRI people told that the focus on milk in sheep became stronger in the recent years in an increasing absence of cattle. Also there was quite a big number of goats around, I guess also mostly for milk.
The farmer we were visiting was new in the project, so we did not know what to expect. At the end both the questions part and the measurement of the animals went quite smoothly, although it took a little longer than expected. The farmer turned out to be the elder small “village” and he asked if the other surrounding flocks could join the program. This was a very good sign that he is interested in the program. I am not sure if he was aware of the benefits that a recording and selection program could give, but in any case in the mid-long term it would definitely help them to increase production and income from their flock.

Our next destination was the place of a young Massai who understood our intentions very well. Leonard spoke perfect English, working with ILRI for some time in the past, now a leader of a small organization dealing with various issues. They provide work for a number of local people as well as supporting children with scholarships, so they can study.  He is a farmer in the sheep project, but also has a camp for tourists which we visited for lunch and discussions concluding our efforts during the week. There were several interesting moments during this visit. One of the most memorable ones was the picture of the 4 PhDs and two university professors listening to the explanations of the young Massai in the traditional clothing. It is a pity that I did not took a video during the event, so you could hear his words. If I will be around I will definitely do so.

After leaving Leonard’s place we said farewell to half of the team returning to Nairobi. The SLU group and myself went for a short tour of the Amboseli National Park, which was nearby. Well… It supposed to be nearby… Our contacts told us that it is 1 – 1,5 hours drive, which turned out to be more like 3 - 4 hours in the car. We started quite late on the usual dirt road of rural Kenya. In addition there was a light rain just before, so our progress was somewhat hindered. We, or more precisely our Kenyan recording person, had some idea about the directions, but we put him out close to his home place. He left behind some verbal instructions and a hand drawn map which should lead us to Amboseli. It was a long way, I can tell you… We were in middle of Kenya, in the dark, on a dirt road and all we could see was an occasional wildebeest. Fortunately we hit the a more strudy road before it started to rain again. Frankly, I was starting to prepare for a night in the car.
Finally we arrived to some lodges where we could as for directions and after additional 20-30 kilometers we arrived to the gate of Amboseli park. The funny thing was that we were already in the park. We probably entered it when turning to the main road, but there were zero signs denoting the border area. Of course the first question of the guard was about our non existing tickets. She was not in a good mood, and finding out that we crossed the park border illegally did not added to the friendliness either. Quite the opposite. Our driver went out for some negotiations, and returned with a very friendly person dealing with the tickets. We wanted to come to the park anyway, so the 24 hour valid tickets were a good deal for everybody. The next day we returned to see the touristic part of Kenya, the way we see it on National Geographic or other documentary channels. We could see a number of species, only “simba” was elusive on that day. It was really a great experience to see these animals in their natural habitat.

After a few hours in the park we went for a lunch and afterwards back to Nairobi. It was my last day returning to Vienna the next day.

I was leaving Kenya with a bunch of experiences and thoughts which would undoubtedly shape my thinking about “developing country” issues. After the my previous visit in Addis somebody mailed me:  “ I hope you will get to see through what is sometimes presented on the streets of the big cities--and get to see the country side--it is another life--and the heartbeat of the continent.  Come again and hopefully we will take you round further.”

That happened indeed. I went one step further with a hope that I can continue my journey.

Monday, January 23, 2012

Bland - Altman plot in R

Not so long time ago I did a comparison study of two software packages, more precisely their ability to estimate random effects. The plain approach was to do correlations among the outcomes, and if they were high I assumed that both programs are OK. I presented this to my more experienced colleagues who suggested to use Bland-Altman plots to confirm the results. This is a reasonably simple technique to measure the agreement of the two outcomes. As they say in their paper Statistical methods for assessing agreement between two methods of clinical measurement (pdf linked, worthwile to read):

In clinical measurement comparison of a new measurement technique with an established one is often needed to see whether they agree sufficiently for the new to replace the old. Such investigations are often analysed inappropriately, notably by using correlation coefficients.The use of correlation is misleading. An alternative approach, based on graphical techniques and simple calculations, is described, together with the relation between this analysis and the assessment of repeatability.

 Simple, yet beautifull technique.

Naturally I was searching for implementartion in R. I quickly found and installed a package called ResearchMethods, but personally I thought it has very few soft tuning possibilities (e.g. scaling or color change). I went deeper and found a quite well documented page with a custom/modified R function. 

I used this one, as I could scale the y axis, so the final plot was nicer. On the other hand I also found that this particular function was written for demonstration purposes, but it had difficulties to run on other data.

For example the limits of the y axis were hard coded to -60, 60, which is quite problematic if you are interested in much higher or smaller differences (In my case on the 0.01 level...). Also the data set names were hard coded into the funtion.

So I modified the code to a more generic function like this:

BAplot <- function(x,y,yAxisLim=c(-1,1),xlab="Average", ylab="Difference") {
   d <- ((x + y)/2)
   diff <- x - y        
   plot(diff ~ d,pch=16,ylim=yAxisLim,xlab=xlab,ylab=ylab)
   abline(h=mean(diff)-c(-2,0,2)*sd(diff),lty=2)
}
 You call it as:
BAplot(testSet1,testSet2,yAxisLim=c(-0.1,0.1))

The "testSet"s are the datasets to compare, the yAxisLim modifies the scaling of the axis according to your needs. You might modify the labels of x and y axis if you wish with xlab and ylab.