We show that the S-matrix for electrons propagating in a waveguide has diff
erent statistical properties depending on whether the waveguide cavity shap
e gives rise to chaotic or integrable behavior classically. We obtain distr
ibutions of energy level spacings for integrable and chaotic billiards shap
ed like the waveguide cavity. We also obtain distributions for Wigner delay
times and resonance widths for the waveguide, for integrable and chaotic c
avity geometries. Our results, obtained by direct numerical calculation of
the electron wave function, are consistent with the predictions of random m
atrix theory.