'Is there a way to calculate the pmatrix of a multistate model (using msm package in R) for a 'factor leve frequency'?

I am using the msm package in R to calculate a multistate model with a categorical covariate. To output the probability matrix I am using the function pmatrix.msm(). I can get results for the two specific values of my categorical variable (say 'F' and 'M') separately. However, I was wondering whether I could calculate the pmatrix also for a specific distribution of the categorical variable, e.g., assuming my target population consists of 70% 'F' I don't want to get the results just for 'F', but for the frequency of 70% 'F' and 30% 'M'.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source