In reply to Lisa.

Y is the observed binary variable that records whether each observation was a success (1) or a failure (0). You use Y as a response variable to form a model that predicts the probability of success as a function of the explanatory variables. So, in practice, you don't calculate Y, you observe it in the data. In this article, I used a simulation to simulate Y from a logistic regression model that has known parameter values. A previous article discusses how to simulate data from a logistic model.