Is it really safer to ride in the road than on the sidewalk? I am fairly new to riding, in a city where it is legal to ride in the road or on the sidewalk. In the areas where I need to ride, the roads are busy but the sidewalks are virtually deserted.

I keep hearing that it is safer to ride in the road, but is it really? Are there studies that show (or contradict) this?

It seems like the hazards of riding on the sidewalk are things that are under my control (don't zoom through crosswalks, watch out for cars coming in/out of driveways), while the hazards of riding in the road (people texting while driving, cars passing too close, road rage) I have to rely on other people being careful.

So it seems to me that I am better off riding on the sidewalk where my safety is in my own hands than in the road where my safety is in the hands of all of the drivers around me. But I am new, so I acknowledge there may be other aspects of this that I haven't thought about... so is it really still better for me to ride in the road, and if so, why?

Edit to add: This is a small city in the midwerstern United States. The sidewalks I am talking about are on stretches of road where it's mostly businesses with large parking lots, so there won't be any kids playing or anyone backing out into the road (but still will be people turning from the driveway to the road or the road to the driveway). With the exception of right by a bus stop, you almost never see pedestrians on the sidewalks, it mostly seems to be bicyclists. As an alternative to riding on the sidewalk of this road, I could take a more indirect/winding path through some neighborhoods where it wouldn't feel quite as scary riding in the road and ride in the road there - but is that really any safer than riding on the sidewalk near the busier roads?
In most scenarios, it is not safer for you to ride on the sidewalk. This has been demonstrated numerous times in numerous studies. I won't attempt to site individual studies here, but I will sum up the reasons. 

One is that you create more potential points of impact. When you exit the sidewalk to go through an intersection, driveway, or parking lot entrance/exit you are in danger from the cross traffic as well as parallel traffic making turns. The latter danger is greatly reduced if you ride in the street simply because you are in the same lane as those drivers.

Furthermore, drivers simply aren't watching for cyclists on the sidewalk. Cyclists typically move much more quickly than pedestrians and drivers aren't prepared for that. Cyclists seem to "come out of nowhere" as compared to slow moving pedestrians. Pedestrians are also able to stop much more quickly if a driver doesn't see them.

All that said, there are some situations where cycling on the sidewalk is safer. Personally, if the speed limit is under 40 mph, I typically ride in the street. If it's over 50 mph, I typically ride on the sidewalk. If it's between 40 and 50 mph, I judge the road based on how many entrances and exits there are, how wide the shoulder is, how much traffic there is, etc.

Mike Baranczak said it beautifully in his comment, "Riding on the sidewalk is always a bad idea. But sometimes riding on the road is a worse idea. You have to decide based on individual circumstances."