Last seen 2 hours ago
If you post a followup to your question, use ADD COMMENT, not Add answer. There's a helpful bit of text right over the Add answer box that says:
If you want to provide a solution to the original question, click Add Answer.
Use the ADD COMMENT or ADD REPLY buttons to ask for clarifications, request more details, or respond to a previous answer or comment.
Which is intended to keep you from answering your own question, which makes it look like, well, it's been answered, which presumably was not your intent.
In addition, if you post code, highlight the code and then click on the icon above the text box with all the 101010 in it, so the code is formatted correctly.
Now, as to your question, you cannot directly compute the log fold change, as there is no closed form of the coefficients for a generalized linear model. The log fold change is computed internally, using an iterative function, and helpfully extracted for you. So the reason there is a difference is that what you are calculating isn't how the log fold change is calculated.