msm
msm copied to clipboard
pmatrix.msm output same matrix for time-inhomogeneous MV
I have trained the following MC, cavcov.msm <- msm( state ~ years, subject=PTNUM, data, qmatrix = Q.crude, deathexact = 4, pci=c(5))
However, I found that the pmatrix.msm return the same matrix
pmatrix.msm(cavcov.msm, t=5,covariates = list(timeperiod = "[-Inf,5)")) State 1 State 2 State 3 State 4 State 1 0.5860283 0.11883904 0.09047275 0.2046599 State 2 0.3284243 0.13369903 0.24138845 0.2964883 State 3 0.1162612 0.06737278 0.28557847 0.5307876 State 4 0.0000000 0.00000000 0.00000000 1.0000000
pmatrix.msm(cavcov.msm, t=5,covariates = list(timeperiod = "[5,Inf)")) State 1 State 2 State 3 State 4 State 1 0.5860283 0.11883904 0.09047275 0.2046599 State 2 0.3284243 0.13369903 0.24138845 0.2964883 State 3 0.1162612 0.06737278 0.28557847 0.5307876 State 4 0.0000000 0.00000000 0.00000000 1.0000000
While I also tried directly incorporate the time intervals as covariate and train the MC with covariate it gives me
pmatrix.msm(cavcov.msm, t=5,covariates = list(year_cat=1)) State 1 State 2 State 3 State 4 State 1 0.5845832 0.11847618 0.07195939 0.2249812 State 2 0.3480435 0.14668869 0.16240983 0.3428580 State 3 0.1284523 0.07622653 0.15252812 0.6427930 State 4 0.0000000 0.00000000 0.00000000 1.0000000
pmatrix.msm(cavcov.msm, t=5,covariates = list(year_cat=2)) State 1 State 2 State 3 State 4 State 1 0.4229076 0.18179139 0.1200081 0.2752929 State 2 0.1849439 0.14247673 0.1758076 0.4967718 State 3 0.0513752 0.06856333 0.1713854 0.7086761 State 4 0.0000000 0.00000000 0.0000000 1.0000000
Also I found that the qmatrix are different with two ways of training the MC, any clue?