Using composite methods of quantum chemical calculations and the atomization method, the values of the enthalpy of formation for a test set of 79 compounds in gas phase were calculated with an accuracy of 3.8, 4.5, 4.7 kJ/mol for the G4, G4MP2, CBS-QB3 methods, respectively. According to the results of statistical analysis of deviations of theoretical values from experimental ones, the presence of an error occurring at the geometry optimization step due to unaccounted correlation effects was revealed. For aliphatic amines and alcohols from the considered set of compounds, the values of the p K a for aqueous solutions were calculated by the G4 method including solvent effects by CPCM model. The existence of a correlation between the error in the p K a calculation and the differences in energy values between the highest occupied and lowest unoccupied molecular orbitals for conjugated acidic and basic forms in the solution phase is revealed. A method is put forward to refine the calculation results, using which the p K a values for 20 amines and 20 alcohols were determined with an accuracy of 0.67 and 0.87 p K a units, respectively.