Despite numerous investments that have been made to increase access to education in sub-Saharan Africa, a noteworthy share of children drop out of school prior to completing primary education. To address this issue, this thesis examines the factors that drive education decisions in a rural risky environment. The first chapter focuses on one of the core determinant of education investment that has been under-explored, the opportunity costs of education. To identify these costs that can significantly hinder education, we determine children's productivity on the farm and provide an estimate range of the value of one day of child labor. In order to better understand education decisions in rural sub-Saharan Africa, the second chapter assesses the different benefits of education in rural Tanzania, where family farm is the dominant structure in agriculture and where the technology level is low. Finally, the third chapter investigates whether productivity shocks are detrimental to educational achievement and children’s cognitive skills by considering two particular aspects, the age at which shocks occur, and the length of shocks. This subject is all the more relevant today when the number of productivity shocks is growing. Throughout these three chapters which focus on rural Tanzania, this thesis provides some insight into the role of public policies in protecting and promoting education.