"Statistically it is about 10x less safe to ride against traffic on a sidewalk then to ride with traffic in the road. Obviously there will be exceptions. The most dangerous areas to be on the sidewalk are where you have many intersections or driveways crossing the sidewalk.
You can find this data in Effective Cycling by John Forester."