If you have a model that has predicted values (or residuals) and have the actual y values, (And it makes sense to subtract predicted values from actual values), you could use what's called Efron's pseudo r-squared at the link below. Substituting your predicted values for "predicted probabilities" on the link. (Which comes out to the same formula on the top of the page.)
In summary, the method to obtain the Pseudo R2 value in Stata depends on the type of regression model used. To obtain the Pseudo R2 value in Stata, there are different methods depending on the type of regression model used. Here are some ways to obtain Pseudo R2 in Stata: For a feasible generalized least square (XTGLS) regression model, the Pseudo R2 value can be obtained by running the command "xtgls Y X1 X2 Xn, panels( ...)" in Stata. For a generalized linear model (GLM) regression, Nagelkerke's R2 can be obtained using the "roctab" command to create a table of predicted probabilities and then calculate the Pseudo R2 value. For a random-effects probit model using xtprobit, the Pseudo R2 value is not directly available in the output. However, it can be calculated using the formula 1 - loglikelihood of the model/loglikelihood of the null model. If a Stata command does not supply an R-squared value, a Pseudo R2 value can be calculated using different approximations or analogues to R-squared. These approximations are often labeled "pseudo" and can be found in the literature of the field. I am able to add....Best of luck