Attention on animal behavior and welfare has been increasing. Scientific knowledge about the effect of behavior and welfare on animals' production augmented and made clear the need of improving their living conditions. Among the variables to monitor in dairy cattle farming, lying time represents a signal for health and welfare status as well as for milk production. The aim of this study is to identify the relationship among the lying behavior of dairy cows and milk production, body condition score (BCS), weather variables, and the temperature-humidity index (THI) in the barn from a dairy farm located in Northern Italy. One-year data were collected on this farm with sensors that allowed monitoring of the environmental conditions in the barn and the activity of primiparous lactating cows. Principal components analysis (PCA), factor analysis (FA), generalized linear model select (GLMSelect), and logistic analysis (LA) were carried out to get the relationships among variables. Among the main results, it emerges that the effect of weather parameters is quite restrained, except for THI > 70, which negatively affects the lying time. In addition, the most productive cows are found to lie down more than the less productive ones, and the parameters of milk production, lying time, and BCS are found to be linked by a similar trend.