URBANA, Ill. (AP) _ An agricultural engineer has developed a computer program that takes a little of the risk out of farming by choosing which equipment is best for a particular set-up.

''Then the farmer does not have the risk of buying equipment that is too big and too expensive for the job, or equipment that is too small and costs him time and money,'' said John Siemens of the University of Illinois. ''He knows this is the optimum equipment.''

Siemens said it would take days to analyze all the data and pick the best equipment for a particular farm without the computer, which accomplishes the task in seconds.

''We didn't want it to be a tedious task to use the program so we limited the inputs for the farmer,'' said Siemens.

The farmer tells the computer what field operation he wants to perform, such as plowing, cultivating or harvesting; the number of acres, and the type of crop. Starting and finishing dates also are considered, along with information about likely weather.

The computer works its way down from the largest equipment available to the smallest machinery that will do the job in a timely manner.

''If the equipment is too small, you'll be late regularly,'' said Siemens. ''You can lose yield if you don't get the crops planted and harvested on time.''

The computer schedules field operations and determines the number of work days required, along with the cost of each piece of machinery. The cost includes fuel consumption, repairs, depreciation, interest charges, insurance and storage.

The decision the farmer makes about equipment is especially important now, said Siemens, because the farm economy has been depressed and machinery is expensive. For example, the largest combine in Siemens' program costs $142,000 and the biggest tractor costs $97,000.

''There was a time when some farmers might have bought equipment with more productivity than they really needed,'' said Siemens. ''But they have not bought much in recent years. Now, they want to readjust their thinking and see just what equipment they really can justify.''

The program also could be used to evaluate the machinery a farmer already owns, or to compare the cost of different tillage systems.

Siemens will demonstrate the computer program this weekend at a farm equipment show in St. Louis and will take it to county extension offices this winter to get farmers' reactions.

Eventually, he expects farm implement dealers to have the program in their computers so they can help customers make the right purchases.

''They want to keep the farmer in business and keep him profitable, and one way to do that is to make sure they sell him the right-sized equipment.''