# How to deal with post-stratification weights in regression settings?

I'm given a longitudinal (i.e., panel/repeated measures) dataset with 2 periods and individuals serving as clusters. The response variable is whether a person would support a healthcare bill, so it is a binary response variable. The explanatory variables are the person's political ideology, income, education, gender, and age. (Kindly note that this is an example. The actual dataset is similar.)

The issue is that the data was obtained using a survey; the sampling design is not made known to me. I am also given a variable containing post-stratification weights, which were constructed based on demographic variables like gender as shown below.

Gender Sample Proportion Population Proportion Post-Stratification Weights
Male 20% 50% $$\frac{50\%}{20\%} = 2.5$$
Female 80% 50% $$\frac{50\%}{80\%} = 0.625$$

Based on the above calculations, each individual in the dataset was assigned a post-stratification weight based on their gender.

I would like to fit a mixed effects logistic regression model to the data and also take into account these poststratification weights. With that in mind, I have the following questions:

1. (Theoretical) How do we deal with post-stratification weights in a regression setting? Can they be treated the same as sampling weights?

I understand that sampling weights are incorporated by introducing them into the marginal log likelihood, thereby forming the log pseudolikelihood, which is then maximized to obtain the pseudo-MLE estimators. For instance, below is the Log Pseudo-likelihood for the Logistic Random Intercept Model with Sampling Weights and 2 levels for the sampling design, taken from here. $$\sum_{j = 1}^{n^{(2)}} w_{j} \cdot \log \left(\int \exp \left(\sum_{i = 1}^{n_{j}^{(1)}}w_{i|j} \log f(y_{ij}|\xi_{j})\right) \cdot g(\xi_{j}) \:\mathrm{d}\xi_{j}\right).$$ Can post-stratification weights be treated in an analogous manner?

2. (Practical) What software can be used in this situation (i.e., to fit a mixed effects logistic regression model while also taking into account the poststratification weights)? Ideally, the software would be in R but I'm also open to using other software like Stata as well.

I've looked at @StasK's previous reply and it was mentioned that lme4 doesn't incorporate sampling weights very well. Hence, at the moment, I'm using the function gllamm from Stata which incorporates sampling weights but not post-stratification weights (as far as I know).