Lagos, Nigeria — Nigeria, the world's fourth-largest democracy, goes to the polls Aug. 6 to elect a president - and perhaps to set an example for Africa, which is dominated by one-party governments.
The election will be the first civilian-run vote held here since the military returned to the barracks four years ago. And it will test this nation on several counts:
* On sheer endurance. The country's 50 million voters face the difficult task of choosing among six presidential candidates, and then in successive weeks choosing a new Senate, House of Representatives, state governors, and local state assemblies.
* On the viability of its new constitution. The 1979 law, inspired by the American model, is designed to prevent any single ethnic group or region from monopolizing power.
It requires the presidential victor to go beyond his tribal base of support - and win both a majority of votes and at least 25 percent of the vote in two-thirds of the 19 states. Many will be watching to see if such a plan is workable in Nigeria.
* On viability of the democratic process. Election violence, degenerating into massive disorder, was what spurred the military to take power in 1966. If there is widespread violence this August, the military may again feel obliged to take over. So far, more than 20 people have been killed in election-related violence.
Each of the six political parties here is avidly working for votes. In the absence of opinion polls it is difficult to predict any outcome of the vote. But most analysts think President Shehu Shagari - a tall, bespectacled Muslim northerner from Sokoto State - will be reelected for another four-year term of office.
''When has an African president lost an election?'' they ask. They explain that Africans traditionally vote for those in power, expecting material reward afterward. And they note the President benefits from the prestige of office and gets massive media coverage from government-owned TV, radio, and newspapers.
But Mr. Shagari's moderate image is also a factor in widespread support for him. And he enjoys a rare reputation among Nigerian politicians for honesty and impartiality.
Shagari's image is much brighter than that of his party - the National Party of Nigeria - regarded by the opposition as ''conservative and elitist.'' The NPN is controlled by the largest tribal group, the Hausa-Fulani, but dominates only seven of the 19 states. The President's narrow victory in 1979 was achieved with the support of minority tribes in the ''middle belt'' and the Niger Delta.
A Shagari win is by no means certain, however. He faces strong competition from two veteran political leaders.
One is Chief Obafemi Awolowo, the aggressive and controversial leader of the Yoruba-based Unity Party of Nigeria. The UPN, which controls five states, has a socialist outlook and promotes free education, health care, and low-cost housing.
The other is Dr. Nnamdi Azikiwe, Nigeria's first president and leader of the Ibo-based Nigerian People's Party.
The failure of these two formidable personalities to join forces in an electoral alliance is a factor favoring reelection of Shagari. He may also be helped by a split in the Ibo vote caused by the defection of the Biafran war leader Odumegwu Ojukwu to the NPN. Ibo critics say this was a deal struck in return for his pardon and return to Nigeria in 1982 after 12 years of exile.
But Mr. Ojukwu has so far apparently made little electoral impact. He may even prove to be a ''double-edged sword'' and create a drop in NPN votes in the Niger Delta, whose tribes suffered severely in the Biafran war, says the NPP national secretary, Dr. Alex Fom.
Personalities have tended to push out debate on policies during the campaign. But the opposition parties are now trying to focus attention on the government's economic record.
Declining oil revenues have led to drastic cuts in public spending and imports. A stringent austerity program was begun. Many companies closed due to a shortage of imported raw materials and spare parts. Unemployment shot up. Teachers in several states have not been paid for months.
Senior government officials insist the situation is improving. Oil prices have stabilized and output risen while the recent rescheduling of $1.6 billion of trade debts has provided more breathing space.
Violence has occurred in this election season. Political campaigning was banned in Oyo State in the west, after six people were killed when their car was attacked and set on fire. An official inquiry revealed, however, that the violence stemmed from an old feud between two local communities. Similarly, violence at Maiduguri in the northeast was caused by tribal disputes rather than the election campaign.
Kano State, the most populous of Nigeria's 19 states, is the scene of a closely fought three-cornered contest, whose result could swing the overall election results.
But a potential flash point is the historical northern city of Kano, where more than 4,000 people died in religious riots in December 1980. Those early riots were provoked by fanatical Muslim supporters of the self-proclaimed prophet ''Maitatsine.'' Although he was killed in the rioting, his movement still attracts support, especially among the poor.
The quietest part of the country is the southeast, where bitter memories remain of the 1967-70 civil war in which the Ibos tried to separate Biafra from Nigeria.
''Political violence should not be exaggerated,'' says Science and Technology Minister Ademola Thomas. ''The elections are part of a gradual process of nation-building. Tribal and religious prejudices are being steadily eroded as the democratic system is consolidated,'' he added.
Mr. Thomas, a wealthy Yoruba businessman from Lagos, is one of several southerners in the government.
US and other foreign businessmen would generally welcome a victory by the NPN. One businessman says a Shagari win would ''give continuity and increased stability.''
''We hope all goes smoothly. The national cake is big enough for everyone to have a slice. That is what ensured the success of the last election,'' a businessman commented.