Most people in three African countries have an optimistic outlook despite continuing anger at corruption and economic woes, a survey has found. South Africans, Nigerians and Kenyans all say healthcare and education will be better for the next generation.
More than three-quarters also say that young people who want a good life should stay in their countries rather than emigrate, the Pew report found.
The research agency interviewed 3,330 respondents for the study.
Respondents reported high levels of political engagement, with majorities saying that ordinary citizens could influence their governments if they make the effort.
More than half said they had voted in the past year or at some point in the past - roughly the same level as in the US.
About 70% of people in South Africa and Nigeria - sub-Saharan Africa's two largest economies - say their economies are in bad shape, along with just over half of Kenyans. Large majorities in all three countries also said a lack of jobs was a big problem.
But despite this, most believed that the economic outlook would improve in the next year.
Most South Africans, Nigerians and Kenyans believe that their countries are only run for the benefit of a few groups of people. The majority of respondents say inequality has become worse and about two-thirds say many jobs only go to people who have personal connections.
Most expect this sorry state of affairs to continue - only a third of South Africans and Kenyans believe there will be less government corruption in their countries when today's generation of children are grown up. However, Nigerians are more optimistic, with almost two-thirds saying today's children will face less corruption.
Food and education
Beyond the general findings, Nigerians said food supply and energy shortages were their top priority. The charity Save the Children says up to half of all children under five are malnourished in some parts of north-eastern Nigeria, which has been wracked by an Islamist insurgency. In South Africa, where students have been staging the biggest student protests since the end of apartheid, education was a big issue. The number of people concerned about poor quality schools had increased sharply since the previous year's survey, Pew said. However two-thirds said they were confident things would be better for future generations.
The headline findings mask differing outlooks between the various groups of people making up South African, Nigerian and Kenyan society.
In South Africa, black people were the most optimistic group, with 69% saying they thought the economy - and their own personal finances - would improve over the next year compared to just 46% of white people and 30% of mixed race people.
They also had more confidence that healthcare and education would improve, were less cynical about how government was run and were more likely to believe staying in the country was the best route to a better future.
In Nigeria, Muslims were more upbeat about the economy while Christians were more likely to identify inequality as a major problem. More Christians and fewer Muslims said they thought government was run for the benefit of special interest groups after Muhammadu Buhari, a Muslim, replaced Goodluck Jonathan, a Christian, as president.
In Kenya, people in the Kikuyu and Kalenjin ethnic groups had a more positive outlook than those in the Luhya and Luo ethnic groups. All Kenya's presidents since independence have been either Kikuyu or Kalenjin.
Where do Africans look for inspiration?
When asked by Pew for models of economically developed countries to emulate, most respondents cited the US and China, but for different reasons.
In Kenya, where concern about government corruption was particularly widespread, 36% of respondents said the US was the best model because of its mode of governance and low levels of corruption. Only 15% cited China as the best example to follow.
In South Africa, 27% of respondents said the US was the best example of an economically developed country, slightly more than the 22% who chose China. And in Nigeria 28% of people cited China as the best example against 25% choosing the US.
Those looking to China said they admired the country's embrace of technology, manufacturing sector, level of exports and strong work ethic.