Unobserved heterogeneity of crashes remains a significant issue for freeways that influence crash prediction, and therefore deserves much attention. Using a fusion data set of crash data, driving behavior data, and traffic flow data, this study explores the spatiotemporal heterogeneity of crash determinants for different freeway segments (e.g. Yixing section and Liyang section of Ning-Hang freeway of China) and then predict the crash probability. A random effect negative binomial regression model is built to investigate the contributing factors of the crashes. Remarkable differences are observed in the crash determinants for Yixing section (include average vehicle speed, hourly average traffic volume, average free speed, road segment length, and number of left lane-merging) and Liyang section (include average intensity of aggressive driving behavior, average kilometer traffic volume). The results found the traffic flow has a more significant impact on crashes than the driving behaviors. It is found that the crash probability is a monotone decreasing function when the predicted number of crash is 0. With the increase of the number of predicted crash, the crash probability gradually converges from a large value to 0. Then the probability of other predicted number of crashes (e.g. crash = 1, crash = 2, crash = 3) presents a quadratic parabola trends. The model comparison demonstrates that the proposed model outperforms conventional model, and the prediction performance for Liyang section is better than that of Yixing section. The research findings are interesting and important for preventing crashes.