Formation energies of group I and II metal oxides using random phase approximation